Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

why wont my simple script even do something? StarterGui

there is no error in this simple script. it is just not doing anything.

game.Players.PlayerAdded:Connect(function(plr)
	plr.PlayerGui.LoadingScreenGui.Loading.Visible = true
end)

new script that works:

game.Players.PlayerAdded:Connect(function(plr)
	plr:WaitForChild("PlayerGui"):WaitForChild("LoadingScreenGui"):WaitForChild("Loading").Visible = true
end)

5 comments

0

if it helps it is a normal script

0

Where is the script located

0

read the title, StarterGui

0

Is it a server script or local script

0

he did say it's a "normal script"

3 answers

✓ Accepted answer

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

2 comments

0

I already tried that before, it has a error code, LoadingScreenGui is not a valid member of PlayerGui "Players.xxaxxaz.PlayerGui"

0

it ends up I needed to change the script and move it to server script service

Dude, never ever change guis via server script, make it as a local script.

local Player = game.Players.LocalPlayer
Player.PlayerGui.LoadingScreenGui.Loading.Visible = true

1 comment

0

I dont want to use a local script because I want the server to change not the players computer only.

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:

game.Players.PlayerAdded:Connect(function(plr)
	plr:WaitForChild("PlayerGui"):WaitForChild("LoadingScreenGui"):WaitForChild("Loading").Visible = true
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.