Hey, this script moves a model a few studs to the left and then a after a few seconds returns back to its original position however sometimes (usually after the first time the model has been back and forth) the model moves further than intended. Why is this happening? Any help would be greatly appreciated! :D
Here is the script:
local Frozen = false
X=script.Parent.Parent.Parent.Anima
function Slowdown(hit)
if Frozen then return end
wait(4)
wait()
for i= 1, 20 do
X:TranslateBy(Vector3.new(0, 0, 0.015))
Frozen = true
wait()
end
wait(15)
for i= 1, 20 do
X:TranslateBy(Vector3.new(0, 0, -0.015))
wait()
end
wait(45)
Frozen = false
end
script.Parent.Touched:Connect(Slowdown)
