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: Help not working properly

Previous Thread :: Next Thread 
thedoomlord12 is not online. thedoomlord12
Joined: 07 Feb 2008
Total Posts: 1470
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 is not online. Vengroe
Joined: 16 Feb 2009
Total Posts: 3057
12 Oct 2009 04:34 PM
Did you run thru Command/Output?
Report Abuse
thedoomlord12 is not online. thedoomlord12
Joined: 07 Feb 2008
Total Posts: 1470
12 Oct 2009 04:38 PM
Yeah it works. But if a player joins Bright red from another team it breaks.
Report Abuse
crazypichu2 is not online. crazypichu2
Joined: 04 Jan 2008
Total Posts: 5526
12 Oct 2009 04:39 PM
dont give the option to change teams then. :S
Report Abuse
thedoomlord12 is not online. thedoomlord12
Joined: 07 Feb 2008
Total Posts: 1470
12 Oct 2009 04:42 PM
I would but thats the point of my game script. It switches teams around
Report Abuse
thedoomlord12 is not online. thedoomlord12
Joined: 07 Feb 2008
Total Posts: 1470
12 Oct 2009 04:46 PM
Bump.
Report Abuse
thedoomlord12 is not online. thedoomlord12
Joined: 07 Feb 2008
Total Posts: 1470
12 Oct 2009 05:20 PM
Bump :3
Report Abuse
ElectricAxel is not online. ElectricAxel
Joined: 15 May 2009
Total Posts: 16239
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
thedoomlord12 is not online. thedoomlord12
Joined: 07 Feb 2008
Total Posts: 1470
13 Oct 2009 04:14 PM
Wait so i just copy the part that kills the person there?
Report Abuse
thedoomlord12 is not online. thedoomlord12
Joined: 07 Feb 2008
Total Posts: 1470
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
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