Hello there,
I’ve been having this problem with my tool for a while. I keep getting this error saying "Infinite Yield on ParryEnduranceUI:WaitForChild(“Val”). Does anyone know what that means and how to fix it?
Hello there,
I’ve been having this problem with my tool for a while. I keep getting this error saying "Infinite Yield on ParryEnduranceUI:WaitForChild(“Val”). Does anyone know what that means and how to fix it?
Instance:WaitForChild(name, timeout), if you don’t supply the timeout it can yield forever; and Roblox will warn you if it doesn’t return in 5 seconds. If you supplied a timeout, if the time you supplied has passed it will just return nil.
Options to fix it:
An actual, possible error: You rename an object to “Val”, WaitForChild doesn’t listen for name changes.
I would assume the 3rd option is the one you’d want.
Val is the correct name.
How would I add a timeout?
It would be :WaitForChild(“Val”, 5), for example. But since the instance exists, you may or may not want it. Instead, try doing something like wait(5) and then print all the children, see what exists. It could come down to how you’re taking the UI from under the script.
Also I just noticed the screenshot has the script parented under a ServerScript, that’s not good practice.
Yeah its inside a localscript.
Is it fine that way or should I put it somewhere like in the ReplicatedStorage
It can depend on the case but the LocalScript should probably be in a Starter_ container.