#escalator problems

1 messages · Page 1 of 1 (latest)

nova oyster
#

hi so i used a script from youtube because im shit at coding (lol) but when i launch it, the steps run away & then respawn extremely spaced. + it only goes up but i need it to go both down & up.

      • Code Below


table.sort(steps, function(a, b)

    return a.Position.Y < b.Position.Y
end)


local startPos = steps[1].Position

local endY = startPos.Y + (#steps - 1) * steps[1].Size.Y


local speed = 2


local ts = game:GetService("TweenService")
local ti = TweenInfo.new(speed, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut)



while wait(speed) do

    for i, step in pairs(steps) do
        
        
        local y, z = (1 / speed) * step.Size.Y, (1 / speed) * step.Size.Z

        step.Velocity = Vector3.new(0, y, z)


        if math.floor(step.Position.Y + 0.5) >= math.floor(endY) then

            step.Position = startPos
        end


        local tween = ts:Create(step, ti, {Position = step.Position + Vector3.new(0, step.Size.Y, step.Size.Z)})

        tween:Play()
    end
end```
round ruin
wicked umbra
#

Was it working before and then it suddenly broke or did it not work from the beginning?

wicked umbra
round ruin
#

yes