So i made this simple localscript for a chassis, inside its plugins folder
local FE = workspace.FilteringEnabled local F = {} local DriveSeat = script.Parent.Parent:WaitForChild("DriveSeat") local car2 = DriveSeat.Parent if car2.Body.Rogue.Engine.Crash.Disabled == true then script.Parent.Parent.IsOn.Value = false end
All it should do is go to body, the car, the engine mesh part, the crash script and check if its disabled and then go to A-Chassis Interface and disabled the IsOn value. but i keep getting
"Infinite yield possible on 'Players.NICULL897.PlayerGui:WaitForChild("DriveSeat")'" I've been spending the last 2 hours and a half trying to figure out why. i don't know if im missing something obvious or not
If a call to the WaitForChild function exceeds 5 seconds without returning the instance you are looking for, and no timeOut parameter has been specified, a warning will be printed to the output that the thread may yield indefinitely; this warning takes the form Infinite yield possible on X:WaitForChild("Y")
, where X is the parent name and Y is the child object name.
so basically, the waitforchild function waited more than 5 seconds and can't find what you are looking for and since you didn't add a timeOut parameter, the game thinks it the script will wait forever.
To not get this warning just add a timeOut parameter like this:
X:WaitForChild("Y",1) -- 1 is the timeOut parameter. It means that waitforchild will only wait 1 second at most and if it can't find what you are looking for in 1 second, it will continue the script by returning nil (nothing).