Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do i change the speed of a moving platform without changing the time between the frames?

Asked by 6 years ago
Edited by M39a9am3R 6 years ago

I have this script: Its a power up

inuse = false
recharge = 1

function onTouched(hit)
    if (hit.Parent:findFirstChild("Humanoid") ~= nil) and (inuse == false) and (hit.Parent:findFirstChild("Powerup") ~= nil) then
        if (hit.Parent.Powerup:findFirstChild("Heavy") ~= nil) then --checks if player is heavy
        inuse = true
            for i=1,14 do
            wait(10)
            script.Parent.Button.CFrame = script.Parent.Button.CFrame - Vector3.new(0, 0.05, 0)
            script.Parent.Door.CFrame = script.Parent.Door.CFrame - Vector3.new(0, -15, 0) --open door
            end
            wait(recharge - 0.35)
            for i=1,14 do
            wait(0.25)
            script.Parent.Button.CFrame = script.Parent.Button.CFrame + Vector3.new(0, 0.05, 0)
            script.Parent.Door.CFrame = script.Parent.Door.CFrame + Vector3.new(0, -15, 0) --close door
            end
        inuse = false
        end
    end
end

script.Parent.Button.Touched:connect(onTouched)

How do i make the platform that goes up go the same speed as it does now, without it having so much time between the frames (if you could make a script that does the same as this does but without powerup and it goes smoother, i would be very happy)

-thx

0
Please post your script in a script block. marketmanager1 52 — 6y
0
Yes, please post your script in a script block so we can understand it, like markeymanager1 said. JellyYn 70 — 6y

Answer this question