game.Players.PlayerAdded:connect(function(player) game.Players:WaitForChild(player) print("I have waited now.") game.Players.player:WaitForChild("PlayerGui") print("That too.") local A = Instance.new("IntValue") A.Parent = game.Players.player.PlayerGui A.Name = "PlayerStatus" A.Value = 5 end)
Not working at all. When I join it basically says that PlayerGui is not a valid member of Player. What's that supposed to mean? Please help. It's broken. It's supposed to add an IntValue.
Remember, player is an object, not a string. You also have no need to do game.Players.player, you can just use player.
game.Players.PlayerAdded:connect(function(plr) repeat wait() until plr.Character --Waits until the character is loaded. local A = Instance.new("IntValue") A.Parent = player.PlayerGui A.Name = "PlayerStatus" A.Value = 5 end)