|
| 13 Dec 2013 08:38 AM |
Hello, I am trying to make a simple script for my game that utilizes the PlayerRemoving event of the Players service. I am aware that my script is correct, as I receive no errors, and other parts of the script do work.
r = game.Players.rnum.Value -- number of people on red team b = game.Players.bnum.Value -- number of people on blue team
-- working parts here
game.Players.PlayerRemoving:connect(function(plr) if plr.TeamColor == 1004 then -- if on team red then r.Value = r.Value - 1 -- take one away from red players elseif plr.TeamColor == 1010 then -- otherwise, if on blue team then b.Value = b.Value - 1 -- take one away from blue players end end) |
|
|
| Report Abuse |
|
|
| |
|
velibor
|
  |
| Joined: 24 Nov 2009 |
| Total Posts: 1003 |
|
|
| 13 Dec 2013 09:42 AM |
You can't compare TeamColors like that..
|
|
|
| Report Abuse |
|
|
| |
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
|
| 13 Dec 2013 10:53 AM |
if plr.TeamColor ==BrickColor.new("Bright red") then
elseif plr.TeamColor == BrickColor.new("Bright blue") then |
|
|
| Report Abuse |
|
|
|
| 13 Dec 2013 11:30 AM |
| Thank you, smiley! Works great now. |
|
|
| Report Abuse |
|
|