Hello, I've got this kind of simple script here, it works like this:
You touch a part, and then a model moves.
The problem is, if you keep touching the part, which isn't supposed to happen, the script goes nuts and moves way too fast.
How do I fix this?
Script:
workspace.BlockingGate.PrimaryPart = workspace.BlockingGate.Center
script.Parent.Touched:connect(function()
for i = 1,100 do
wait()
workspace.BlockingGate:SetPrimaryPartCFrame( CFrame.new(workspace.BlockingGate.PrimaryPart.Position + Vector3.new(0,-0.5,0)) )
end
wait (2)
for i = 1,100 do
wait()
workspace.BlockingGate:SetPrimaryPartCFrame( CFrame.new(workspace.BlockingGate.PrimaryPart.Position + Vector3.new(0,-0.5,0 )) )
end
wait (2)
end)
Thanks for helping
