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: Please fix

Previous Thread :: Next Thread 
JoelC2 is not online. JoelC2
Joined: 28 May 2010
Total Posts: 344
16 Mar 2012 09:37 PM
Im really tired and dont have a clue whats wrong

if script.Parent.Humanoid.Health == 0 then
script.Parent:remove()

its supposed to removean enemy when its health = 0
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
16 Mar 2012 09:38 PM
Use a .Died event.

† KMXD †
Report Abuse
DXPower is not online. DXPower
Joined: 21 Oct 2008
Total Posts: 2866
16 Mar 2012 09:38 PM
    if script.Parent.Humanoid.Health == 0 then
    script.Parent:Destroy() --They changed Remove to Destroy
    end

"Sometimes the questions are complicated and the answers are simple." -Dr. Seuss
Report Abuse
Abillityx is not online. Abillityx
Joined: 26 Feb 2011
Total Posts: 3938
16 Mar 2012 10:26 PM
function onPlayerDied()
if h.Health = 0 then
script.Parent:Destroy()
end
end


I think that should work. I am only a beginner.....
Report Abuse
Quenty is not online. Quenty
Joined: 03 Sep 2009
Total Posts: 9316
16 Mar 2012 10:30 PM
script.Parent.Humanoid.Died:connect(function()
script.Parent:Destroy()
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