|
| 12 Oct 2009 04:32 PM |
Okay for the following script if a player is on Bright red and has under 10hp they die after 25 seconds.
My problem is if someone joins Bright red from another team then this script doesn't work. can anyone help?
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character,deb)wait()deb=false if(player.TeamColor~=BrickColor.new("Bright red"))then return end character.Humanoid.Changed:connect(function(prop,counter) if(character.Humanoid.Health>10)or(prop~="Health")or(deb)then return end deb=true counter=0 repeat wait(1) counter=counter+1 if counter==25 then character:BreakJoints()end until character.Humanoid.Health==0 or character.Humanoid.Health>10 or counter==25 deb=false end) end) end)
|
|
|
| Report Abuse |
|
|
Vengroe
|
  |
| Joined: 16 Feb 2009 |
| Total Posts: 3057 |
|
|
| 12 Oct 2009 04:34 PM |
| Did you run thru Command/Output? |
|
|
| Report Abuse |
|
|
|
| 12 Oct 2009 04:38 PM |
| Yeah it works. But if a player joins Bright red from another team it breaks. |
|
|
| Report Abuse |
|
|
|
| 12 Oct 2009 04:39 PM |
| dont give the option to change teams then. :S |
|
|
| Report Abuse |
|
|
|
| 12 Oct 2009 04:42 PM |
| I would but thats the point of my game script. It switches teams around |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 13 Oct 2009 01:20 PM |
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character,deb)wait()deb=false if(player.TeamColor~=BrickColor.new("Bright red"))then return end character.Humanoid.Changed:connect(function(prop,counter) if(character.Humanoid.Health>10)or(prop~="Health")or(deb)then return end deb=true counter=0 repeat wait(1) counter=counter+1 if counter==25 then character:BreakJoints()end until character.Humanoid.Health==0 or character.Humanoid.Health>10 or counter==25 deb=false end) character.Changed:connect(function(property) if property == "TeamColor" then --put here what happens :P end end) end) end) |
|
|
| Report Abuse |
|
|
|
| 13 Oct 2009 04:14 PM |
| Wait so i just copy the part that kills the person there? |
|
|
| Report Abuse |
|
|
|
| 13 Oct 2009 06:46 PM |
I tried this but it's not working.
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character,deb)wait()deb=false if(player.TeamColor~=BrickColor.new("Bright red"))then return end character.Humanoid.Changed:connect(function(prop,counter) if(character.Humanoid.Health>10)or(prop~="Health")or(deb)then return end deb=true counter=0 repeat wait(1) counter=counter+1 if counter==25 then character:BreakJoints()end until character.Humanoid.Health==0 or character.Humanoid.Health>10 or counter==25 deb=false end) character.Changed:connect(function(property) if property == "TeamColor" then repeat wait(1) counter=counter+1 if counter==25 then character:BreakJoints()end until character.Humanoid.Health==0 or character.Humanoid.Health>10 or counter==25 deb=false end end) end) end) |
|
|
| Report Abuse |
|
|