Cant get all players and all new players

I cant get all the players and new players. This script only detects my player and wont find any new people that join, or already existing people in the server.

game.Players.PlayerAdded:Connect(function(P)
	task.spawn(function()
		
		P.CharacterAdded:Wait()
		print("Char: "..P.Name)
		
	end)
end)

for _, V : Player in game.Players:GetChildren() do
	task.spawn(function()

		V.CharacterAdded:Wait()
		print("Char: "..V.Name)

	end)
end

This wont detect new players who join the game. How do i fix that?

why are u using task.spawn()? If i was making that script u wouldn’t need it I think.

i was just trying any last resort, but i got it fixed. Ill mark this message as solution

1 Like

I usually do the same to simulate event behavior(no yielding, errors not breaking the loop).

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.