コンテンツへスキップ
動作中

opensource tween to folder

DEDeerHunter560 閲覧数Universal2026年7月22日
共有
opensource tween to folder

スクリプトコード

Lua
local Players = game:GetService("Players")
local TS = game:GetService("TweenService")
local US = game:GetService("UserInputService")
local RS = game:GetService("RunService")
local LP = Players.LocalPlayer

local folder = workspace:FindFirstChild("folder name") -- change

if not folder then
    print("no folder found")
    return
end

local parts = {}
local index = 1
local tweening = false
local enabled = false
local speed = 300

local function CollectShit()
    parts = {}
    for _, part in pairs(folder:GetDescendants()) do
        if part:IsA("BasePart") then
            table.insert(parts, part)
        end
    end
    if #parts == 0 then
        print("no parts found")
    end
end

CollectShit()

local function TweenToPart(part)
    if tweening or not part or not part.Parent then return end

    local char = LP.Character
    local root = char and char:FindFirstChild("HumanoidRootPart")
    if not root then
        print("no rootpart found")
        return
    end

    tweening = true

    local targetPos = part.Position
    local distance = (root.Position - targetPos).Magnitude
    local duration = math.max(distance / speed, 0.05)

    local noclip = {}
    for _, p in pairs(char:GetDescendants()) do
        if p:IsA("BasePart") then
            noclip[p] = p.CanCollide
            p.CanCollide = false
        end
    end

    local tween = TS:Create(root,
        TweenInfo.new(duration, Enum.EasingStyle.Linear),
        {CFrame = CFrame.new(targetPos + Vector3.new(0, 2, 0))}
    )

    tween:Play()
    tween.Completed:Wait()

    for p, clip in pairs(noclip) do
        if p and p.Parent then
            p.CanCollide = clip
        end
    end

    tweening = false
end

local function loop()
    if #parts == 0 then return end

    while enabled do
        local target = parts[index]
        if target and target.Parent then
            TweenToPart(target)
        end
        index = index + 1
        if index > #parts then
            index = 1
        end
        task.wait(0.05)
    end
end

US.InputBegan:Connect(function(input, gameProcessed)
    if gameProcessed then return end
    if input.KeyCode == Enum.KeyCode.F then
        enabled = not enabled
        if enabled then
            CollectShit()
            if #parts == 0 then
                enabled = false
                return
            end
            index = 1
            task.spawn(loop)
        end
    end
end)

folder.DescendantAdded:Connect(function()
    if enabled then
        CollectShit()
    end
end)

print("press f to start tweening")

説明

change the local folder variable to wtv folder you want to tween to toggle key is f use it as reference for your script or smt idk if its too fast change the speed

コメント (0)

会話に参加するにはログインしてください

  • 最初のコメントを投稿しましょう。

よくある質問

opensource tween to folderスクリプトはどう使いますか?
上のスクリプトコードをコピーし、RobloxでUniversalに参加して、エグゼキューターに貼り付けて実行してください。スクリプトが動くとすぐに機能が有効になります。
opensource tween to folderはまだ動作しますか?
はい。opensource tween to folderは現在「動作中」とマークされています(最終更新: 2026年9月9日)。Robloxのアップデートで動かなくなった場合は、更新版をお待ちください。
opensource tween to folderに対応するエグゼキューターは?
このスクリプトはほとんどの人気Robloxエグゼキューターで動作します。お使いのデバイス向けの信頼できる無料または有料エグゼキューターを見つけるには、エグゼキューターページをご覧ください。