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

How to infinite yeild possible on this lone of code?

local hum = game.Players:FindFirstChild("Humanoid")

local frame = script.Parent:WaitForChild("TextButton").TextButton.Parent.Frame wait() local open = false

script.Parent.MouseButton1Click:Connect(function() if frame.Visible == false then frame.Visible = false else frame.Visible = false end end)

6 comments

0

Please write down your code in proper code format so I can take a c!ear look into your script. I can't understand this script..

0

Assuming your script is formatted properly in your script, I would rename local frame variable and see if you get the same error. Looks like a sequencing error with the parent.

0

Yeah probably..

0

well i fixed the problem and now i have inf yeild

0

Please make sure your script is in proper code format and infinite yeild means that something does not exist, make sure everything you inputted on the script actually exists.. What is the full output error?

0

Infinite yield possible on 'Players.ivan6361.PlayerGui.ExitGui.Frame.TextButton:WaitForChild("TextButton")'

1 answer

So when you have an infinite yield when dealing with WaitForChild(""), it's waiting for the child that never comes and so waits infinitely. So TextButton may not be named correctly or in the wrong place, or something with your path is messed up.

In the error the path says Player.Gui.ExitGui.Frame.TextButton:WaitForChild("TextButton") so unless TextButtons Parent is also a TextButton you might just need to say Script.Parent

Otherwise name your buttons better man.

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