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

How to infinite yeild possible on this lone of code?

Asked by 4 years ago
Edited 4 years ago

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)

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.. SilentsReplacement 468 — 4y
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. doncellanerdy 21 — 4y
0
Yeah probably.. SilentsReplacement 468 — 4y
0
well i fixed the problem and now i have inf yeild ivan6361 34 — 4y
View all comments (2 more)
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? SilentsReplacement 468 — 4y
0
Infinite yield possible on 'Players.ivan6361.PlayerGui.ExitGui.Frame.TextButton:WaitForChild("TextButton")' ivan6361 34 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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.

Ad

Answer this question