#WaitForChild("") refusing to actually wait

1 messages · Page 1 of 1 (latest)

left lynx
#

I have a LocalScript and the first line waits for the ScreenGUI to be copied in the player's PlayerGui

local gui = game:GetService("Players").LocalPlayer.PlayerGui:WaitForChild("ScreenGui")

The warning I get is "Infinite yield possible on 'Players.username.PlayerGui:WaitForChild("ScreenGui")'

rotund shoal
#

wdym its refusing to wait??

#

It means that theres no ScreenGui

#

what did you name your screengui to

left lynx
#

its still called ScreenGui

#

didnt bother to change it :P

rotund shoal
#

send ss

#

cus infinite yield means it may wait forever for it

left lynx
#

idk why its greyed out

#

i didnt set a setting or diable it or smth

#

it just happens when playtesting

#

but doesnt leave :/

#

the screengui DOES eventually come up but the waitforchild is too impatient to actually do its job >:(

#

and throws a warning

#

know anything that could help @rotund shoal?

rotund shoal
#

Use waitforchild when it comes up?? or idk however u want to do it

left lynx
#

a

foggy pagoda
#

give the scripts in full

left lynx
#

uhh no thats the whole script

#

the same also happens for a part i added to the workspace

#

and also it only happens sometimes

slow garnet
#

I just adjust my script to where I can cache it with dot operators

jagged forge
jagged forge
left lynx
#

wait u can do that???

celest cedarBOT
#

studio** You are now Level 5! **studio

jagged forge
#

yup

#

if that wont work try: repeat task.wait() until game.Loaded

#

put that at beggining of your script

left lynx
#

also @jagged forge u know how to make badgeservice:userhasbadgeasync() faster? i am using task.spawn but its still not enough, and because its async something wont wait for it to finish first

jagged forge