This is a ServerScript in ServerScriptService
It only detects one player and it doesn’t detect anyone else.
for _, v in pairs(game.Players:GetPlayers()) do
print(v.Name)
end
This is a ServerScript in ServerScriptService
It only detects one player and it doesn’t detect anyone else.
for _, v in pairs(game.Players:GetPlayers()) do
print(v.Name)
end
It’s because you are the only one in the server. If you are playing with more people, it will show everyone’s names in the server.
If you’re playing on your own then that’s the reason why.
I’m trying this on a Local Test Server with 2 players.
It’s probably being run when the server starts only. So that would be when player 1 joins the server. By the time player 2 has joined the code has already finished executing.
It’s in a function. Basically when more than 1 player is ready it finds all players and gives them an outfit.
It only finds one player when looking for players which is confusing me because it’s worked for me before.
Check the code that calls the function then - maybe it’s calling on it too early.
Alright sounds good, I’ll try it out.
Nope. It already has 5 seconds before the round starts.
Try changing it to ipairs
for _, v in ipairs(game.Players:GetPlayers()) do
print(v.Name)
end
Nope, same thing happening again.
I am so dumb.
I had a :wait() when the player died in the function