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

platform not moving when you press the button?

Asked by 1 year ago

So when you press the 2nd button in my game, its supposed to make this platform move up and down, but instead it stays still even when you press the button.

local part = script.Parent
local button = workspace.Button2.button2.scriptpart2
local e = 1
button.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild('Humanoid') then

        repeat wait() until button.Touched 
        while true do
            part.CFrame = CFrame.new(36, script.Parent.CFrame.Y + 0.02 * e, -36)
            wait(0.02)
            if script.Parent.CFrame.Y > 20 then
                e = -1
                wait(3)
                if script.Parent.CFrame.Y < 3 then
                    e = 1
                    wait(3)
                end
           end
        end 
    end
end)

1 answer

Log in to vote
0
Answered by 1 year ago

try to slowly increse the Y axis. Add 1 every 0.1 seconds or something. Good Luck!!!

Ad

Answer this question