|
| 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
|
  |
| Joined: 20 Jul 2012 |
| Total Posts: 3191 |
|
|
| 24 Jan 2015 03:00 PM |
| If game.Workspace.NPC.Humanoid.health =< (Certain amount) then |
|
|
| Report Abuse |
|
|
|
| 24 Jan 2015 03:04 PM |
15:02:07.731 - Humanoid is not a valid member of Model Error :P |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|