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: I don't think this should error...

Previous Thread :: Next Thread 
TheJKM98 is not online. TheJKM98
Joined: 20 Dec 2010
Total Posts: 511
17 Nov 2013 05:00 PM
The following code is in a LocalScript:

while true do
if game.Players.LocalPlayer.Character.Humanoid.Health == 0 then
game.Players.LocalPlayer.TeamColor = BrickColor.new("White")
end
wait()
end


The problem: Every time the player dies, they stay on their team. There are no errors in the output, so why isn't the dead player changing teams?
Report Abuse
Bebee2 is not online. Bebee2
Joined: 17 May 2009
Total Posts: 3985
17 Nov 2013 05:01 PM
if game.Players.LocalPlayer.Character.Humanoid.Died:connect(function()
game.Players.LocalPlayer.TeamColor = BrickColor.new("White")
end)
Report Abuse
TheJKM98 is not online. TheJKM98
Joined: 20 Dec 2010
Total Posts: 511
17 Nov 2013 05:03 PM
The format is incorrect, please revise
Report Abuse
Cjslick is not online. Cjslick
Joined: 11 Jul 2009
Total Posts: 2130
17 Nov 2013 05:04 PM
That format looks fine
Report Abuse
TheJKM98 is not online. TheJKM98
Joined: 20 Dec 2010
Total Posts: 511
17 Nov 2013 05:06 PM
Look again, there is no 'then'

Can someone please revise?
Report Abuse
Scriptural is not online. Scriptural
Joined: 06 Sep 2013
Total Posts: 2979
17 Nov 2013 05:08 PM
It doesn't need it then, it works.
Report Abuse
TheJKM98 is not online. TheJKM98
Joined: 20 Dec 2010
Total Posts: 511
17 Nov 2013 05:11 PM
There must be something wrong, because when I reset the player, they stay on the same team.
Report Abuse
Scriptural is not online. Scriptural
Joined: 06 Sep 2013
Total Posts: 2979
17 Nov 2013 05:13 PM
You need to make sure they have a character and humanoid.
Or just make it a normal on enter script
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