|
| 23 Nov 2017 04:00 PM |
I have made a script that saves the Number of players in a team into an IntValue. This script works.
game.Teams["Flyweight"].PlayerAdded:connect(function(player) game.Workspace:WaitForChild("Flyweight NumPlayers").Value = game.Workspace:WaitForChild("Flyweight NumPlayers").Value + 1
But when I try to remove the player when they have left it says 'PlayerRemoving is not a valid member of Team' the broken area of the script is below.
game.Teams["Flyweight"].PlayerRemoving:connect(function(player) game.Workspace:WaitForChild("Flyweight NumPlayers").Value = game.Workspace:WaitForChild("Flyweight NumPlayers").Value - 1 end)
Please help.
|
|
|
| Report Abuse |
|
|
chaust
|
  |
| Joined: 05 Jul 2011 |
| Total Posts: 175 |
|
|
| 23 Nov 2017 04:08 PM |
| PlayerRemoving is not a function of teams its a function of players. |
|
|
| Report Abuse |
|
|
|
| 24 Nov 2017 01:16 AM |
what would I do to fix this?
|
|
|
| Report Abuse |
|
|
|
| 24 Nov 2017 01:26 AM |
when someone leaves you check their team
|
|
|
| Report Abuse |
|
|
| |
|