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

Attributes are not currently enabled?

I am trying to make an attribute for the Players service that holds the number of players in game (as NumPlayers was deprecated). If I try to get the attribute, the output prints Attributes are not currently enabled . Can anyone help me with this?

1 answer

✓ Accepted answer

You don't need to make any big edits on attributes, you can use game.Players:GetPlayers() to get a table of the players on the server, and then you just need to get the size of the table:

local plrs = game.Players:GetPlayers()
print(#plrs) -- this will print the number of players

2 comments

0

would i have to update the table when a player joins?

1

yes, you can table.insert() the player or just use :GetPlayers() again

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