Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to fix an infinite yield in a click detector script?

Infinite yield possible on 'Workspace.AoTCannonbyToadion:WaitForChild("ClickDetector")'

Can anyone tell me how to fix this or at least what may be causing the problem?

1 comment

0

Make sure there's actually a ClickDetector inside of AoTCannonbyToadion.

1 answer

✓ Accepted answer

infinite yield means that roblox couldn't find it, and it gave up on waiting for it. Make sure there is a click detector in the part. Or, you could make one in the script.

local click=Instance.new("ClickDetector")
click.Parent=script.Parent
--rest of the stuff here, you can reference the detector as 'click'

1 comment

0

Thank you that worked!

This discussion is preserved as it was. New answers, comments, and votes are closed.