Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I get other players except the client?

Yes I already know on how to get all players, I was just wondering on how to get other LocalPlayers except you and it would print something.

2 comments

0

To clarify...are you wanting to get all players except you(the player running the code)

0

Yes I am.

1 answer

✓ Accepted answer

You can get a table of all other players by looping through a table of players and putting all of them that are not the LocalPlayer onto a new table. Here's an example of that:

local otherPlayers = {}

for _, v in ipairs(game:GetService("Players"):GetPlayers()) do
	if v ~= game:GetService("Players").LocalPlayer then
		table.insert(otherPlayers, v)
	end
end

If my answer solved your problem please don't forget to upvote and accept it

This discussion is preserved as it was. New answers, comments, and votes are closed.