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

Why won't this gui popup whenever a player joins the game?

Asked by 4 years ago
Edited 4 years ago

print("doo") game.Players.PlayerAdded:Connect(function(player) player:WaitForChild("PlayerGui") player:WaitForChild("GymRules") player.PlayerGui.GymRules.Frame.Visible = true end)

When I run the game, theres no output to this but the gui doesn't show up. I did run the game and check in my inventory if both PlayerGui and GymRules was in there, and it was. Why won't this gui popup when a player joins the game? This script is in ServerScriptService, and the gui is in StarterGui with the visibility set on 0. I've tried putting it in Workspace, but that didn't work either.

0
I tried deleted 4 and 5, and I made sure it was enabled and the visibility was set to false, not the background transparency. The script in ServerScriptService is a script, so that's not the issue either. It's still not working. Catherine858 5 — 4y
0
Would you mind joining the scriptinghelpers discord so i can help there? User#21527 0 — 4y
0
I don't mind. I just joined. Catherine858 5 — 4y
0
Post a screenshot of your explorer with the gui and things expanded User#21527 0 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

Maybe the GUI is not enabled if so this script should do

print("doo")
local player = game:GetService("Players").LocalPlayer

game.Players.PlayerAdded:Connect(function(player)
    player:WaitForChild("PlayerGui")
    player:WaitForChild("GymRules")
    player:WaitForChild("PlayerGui").GymRules.Frame.Visible = true
    player:WaitForChild("PlayerGui").GymRules.Enabled = true
end)


also make sure its a local script

goodbye!

Ad

Answer this question