Platform not moving after pressing button and not printing e, so i know it isn't running the rest?
local y = script.Parent.CFrame.Y
local part = script.Parent
local button = workspace.Button2.button2.scriptpart2
local e = 4
button.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild('Humanoid') then
repeat wait() until button.Touched
while true do
repeat wait() until e < 1
part.CFrame = CFrame.new(36, y + 0.05, -36)
e = e - 1
print(e)
wait(0.05)
repeat wait() until e > 9
part.CFrame = CFrame.new(36, y - 0.05, -36)
e = e + 1
print(e)
end
end
end
)