there are scripts that run while a player is trying to join a new server and that sometimes prevents players from actually join the game so then the game is impossible to play. i need someone to make a code to add into a script where the script activates when players actually join the game and are ready to play the game .
Theres two ways to do this :
game:GetService("Players").PlayerAdded:connect(function(player) workspace:WaitForChild(player.Name) -- Code after character spawned here end)
Note : The code will run only once and that is when the player first joins the game
or
game:GetService("Players").PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) -- Code after character spawned here end) end)
Note : The code will run every time a player respawns and not just the first time joining