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 » Game Design
Home Search
 

Re: When Damage Is Taken.

Previous Thread :: Next Thread 
daviddavid16 is not online. daviddavid16
Joined: 31 Aug 2010
Total Posts: 7
24 Jan 2015 02:52 PM
Hello everyone, I'm a new to scripting and I'm confused by the wiki so I was wondering if I could get some help. I'm trying to figure out how to make something happen when an NPC takes a certain amount of damage but I can't find anything on that subject. So I've decided to come to the forum for some assistance.
Report Abuse
yoshiegg6 is not online. yoshiegg6
Joined: 20 Jul 2012
Total Posts: 3191
24 Jan 2015 03:00 PM
If game.Workspace.NPC.Humanoid.health =< (Certain amount) then
Report Abuse
daviddavid16 is not online. daviddavid16
Joined: 31 Aug 2010
Total Posts: 7
24 Jan 2015 03:04 PM
15:02:07.731 - Humanoid is not a valid member of Model
Error :P
Report Abuse
yoshiegg6 is not online. yoshiegg6
Joined: 20 Jul 2012
Total Posts: 3191
24 Jan 2015 03:16 PM
It has a humanoid in it right? Try:

game.Workspace.NPC:FindFirstChild("Humanoid")
if Humanoid ~= nil and Humanoid.health =< (Certain amount) then
Report Abuse
daviddavid16 is not online. daviddavid16
Joined: 31 Aug 2010
Total Posts: 7
24 Jan 2015 03:20 PM
Okay the problem is fixed except, I'm trying to make a part come off of the NPC. Now the problem is even though not welded onto the NPC or anchored it still stays on?
Report Abuse
daviddavid16 is not online. daviddavid16
Joined: 31 Aug 2010
Total Posts: 7
24 Jan 2015 03:20 PM
Let me fix that ^ even though the part isn't welded on or anchored it isn't falling
Report Abuse
daviddavid16 is not online. daviddavid16
Joined: 31 Aug 2010
Total Posts: 7
24 Jan 2015 05:04 PM
Okay I've Fixed the problem if you're wondering what I was doing visit my place.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Game Design
   
 
   
  • 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