Game.Players.PlayerAdded Broken?

for some reason game.Players.PlayerAdded wont work. its a local script in starter gui.

	if game.Players.LocalPlayer.UserId == Settings.Admins.Owner then
		Notification:TweenSize(UDim2.new(0.984, 0,0.034, 100))
		Notification.Where:TweenSize(UDim2.new(0, 200,0, 30))
		Notification.Message:TweenSize(UDim2.new(0, 948,0, 32))
		Notification:TweenPosition(UDim2.new(0.5,0,.5,0))
		Notification.Where:TweenPosition(UDim2.new(0.5, 0,0.106, 0))
		Notification.Message:TweenPosition(UDim2.new(0.5,0,.5,0))
		Notification.Message.Text = "You are the owner. Press the " .. Settings.Keybindings.OpenGui .. " key to open the gui."
	end
end)
1 Like

Generally if you use it locally, whatever callback you pass to Players.PlayerAdded.Connect would not run for connecting players themselves, but it would for players that connect to the game after the script runs for the player. Usually you want to do this on the server so it runs for every connecting player.

This is not correct.

3 Likes

Oh dang. Been told that you could only use PlayerAdded in server scripts.

Don’t use Players.PlayerAdded just use Players.LocalPlayer to reference the player that the local script is exeucuting for.

1 Like