game.Players.PlayerAdded:Connect(function(player)
print("A player has entered: " .. player.Name)
local character = player.Character
if not character then
character = player.CharacterAdded:wait()
end
end) --its literally the api copypaste
If it’s a Script, meaning you want it to run on the server side, put it in ServerScriptStorage. If it’s a LocalScript, where you only want it running on the client, put it in StarterGui, StarterPlayerScripts, or StarterCharacterScripts. I personally prefer either of the first two.