Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Can't change the score on a team?

Asked by 9 years ago

I'm not a very good scripter, but i'm trying to make something so the score of a team is how many players are in the server, I try this script, and It doesn't work, Help anyone?

local players = game.Players:GetChildren()
game.Teams.Players.Score = players

1 answer

Log in to vote
2
Answered by
ImageLabel 1541 Moderation Voter
9 years ago

You are attempting to set a NumberValue (score property) to a table (game.Players:GetChildren())

The length operator # would return the amount of players in this case.

local players = game.Players:GetPlayers()
  game.Teams.Players.Score = #players
  
Ad

Answer this question