Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

why wont my simple script even do something? StarterGui

Asked by
xxaxxaz 42
2 years ago
Edited 2 years ago

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)
0
if it helps it is a normal script xxaxxaz 42 — 2y
0
Where is the script located DietCokeTastesGood 111 — 2y
0
read the title, StarterGui xxaxxaz 42 — 2y
0
Is it a server script or local script DietCokeTastesGood 111 — 2y
0
he did say it's a "normal script" TechModel 118 — 2y

3 answers

Log in to vote
1
Answered by
Jo1nts 134
2 years ago
Edited 2 years ago

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

0
I already tried that before, it has a error code, LoadingScreenGui is not a valid member of PlayerGui "Players.xxaxxaz.PlayerGui" xxaxxaz 42 — 2y
0
it ends up I needed to change the script and move it to server script service xxaxxaz 42 — 2y
Ad
Log in to vote
0
Answered by
Cirillix 110
2 years ago

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
0
I dont want to use a local script because I want the server to change not the players computer only. xxaxxaz 42 — 2y
Log in to vote
0
Answered by
xxaxxaz 42
2 years ago

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)

Answer this question