generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: game.Players.PlayerRemoving Event Not Working For Me

Previous Thread :: Next Thread 
TechPerson32 is not online. TechPerson32
Joined: 25 Dec 2011
Total Posts: 81
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
TechPerson32 is not online. TechPerson32
Joined: 25 Dec 2011
Total Posts: 81
13 Dec 2013 09:41 AM
Bump
Report Abuse
velibor is not online. velibor
Joined: 24 Nov 2009
Total Posts: 1003
13 Dec 2013 09:42 AM
You can't compare TeamColors like that..
Report Abuse
1518NICENICKEY is not online. 1518NICENICKEY
Joined: 29 Apr 2009
Total Posts: 1136
13 Dec 2013 10:03 AM
Above.. :p
Report Abuse
smiley599 is not online. 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
TechPerson32 is not online. TechPerson32
Joined: 25 Dec 2011
Total Posts: 81
13 Dec 2013 11:30 AM
Thank you, smiley! Works great now.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image