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

Why isn't this working?

Asked by 9 years ago

wait()

function onTouched(hit)

 wait()

script.Parent.Anchored = false

script.Parent.Sparkles:Destroy()

script:Destroy()

end

script.Parent.Touched:connect(onTouched)

Nothing appears in the output. It is unanchored upon touch, but still has sparkles.

1 answer

Log in to vote
0
Answered by
dyler3 1510 Moderation Voter
9 years ago
wait()
function onTouched(hit)
wait()
script.Parent.Anchored = false
script.Parent.Sparkles:remove()
script:Destroy()
end
script.Parent.Touched:connect(onTouched)

Everything with this looks alright. I prefer to use the ':remove()' command, but this still should be fine. Try it like this and make sure that you're leading the 5th line to the sparkles correctly.

Ad

Answer this question