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

how come once the part goes over y = 100 it doesn't stop moving?

Asked by
Prioxis 673 Moderation Voter
10 years ago

so I made a part that will fly to y 100 and once it reaches there it should stop moving but it doesn't it just keeps going heres my script

function onClicked(mouse)
script.Parent.Fire.Enabled = true
wait(2)
script.Parent.Anchored = false
script.Parent.Parent.Fire1.Anchored = false
script.Parent.Parent.Fire2.Anchored = false
script.Parent.Parent.Fire3.Anchored = false
script.Parent.Parent.Fire4.Anchored = false
script.Parent.Parent.Fire5.Anchored = false
script.Parent.Parent.Fire6.Anchored = false
 if script.Parent.Position.y >= 100 then
    script.Parent.BodyVelocity:remove()
end
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)

how do I make it stop at 100

1 answer

Log in to vote
0
Answered by 10 years ago

Anchor the part...

Use Destroy() not remove()

Ad

Answer this question