When I try to run script.Parent.ScreenGui2.waiting.Text="Waiting for more players...", along with some other code, it errors out saying "ScreenGui2 is not a valid member of PlayerGui", even though it is. This code is in a localscript, and the following is the entire function containing the code.
local function clickdetection(gui) print(_G.notenoughplayers) if _G.notenoughplayers==true then print("not enough players") buttontransparency(0.5) script.Parent.ScreenGui2.waiting.Text="Waiting for more players..."
What makes this more confusing is that if I created a new localscript and inserted the above code, It would work. Why does it happen/How can I fix it?