there is no error in this simple script. it is just not doing anything.
1 | game.Players.PlayerAdded:Connect( function (plr) |
2 | plr.PlayerGui.LoadingScreenGui.Loading.Visible = true |
3 | end ) |
new script that works:
1 | game.Players.PlayerAdded:Connect( function (plr) |
2 | plr:WaitForChild( "PlayerGui" ):WaitForChild( "LoadingScreenGui" ):WaitForChild( "Loading" ).Visible = true |
3 | end ) |
Make sure your script isn't in starter gui (place it in serverscriptservice instead) and if it is local script convert it to a normal script
Dude, never ever change guis via server script, make it as a local script.
1 | local Player = game.Players.LocalPlayer |
2 | Player.PlayerGui.LoadingScreenGui.Loading.Visible = true |
I fixed it, it ends up the script was running before the rest of the stuff was loaded. so it did not work, I just had to change everything to wait for childs.
new script:
1 | game.Players.PlayerAdded:Connect( function (plr) |
2 | plr:WaitForChild( "PlayerGui" ):WaitForChild( "LoadingScreenGui" ):WaitForChild( "Loading" ).Visible = true |
3 | end ) |