Cheeso135
|
  |
| Joined: 13 Apr 2013 |
| Total Posts: 2016 |
|
|
| 20 Jun 2014 04:55 PM |
| I need to get a model that was made by me, can deal damage, follow players, respawn, etc, take damage when hit with LinkedSword. I haven't figured out a script that will do this. |
|
|
| Report Abuse |
|
|
Locard
|
  |
| Joined: 13 Apr 2014 |
| Total Posts: 3516 |
|
|
| 20 Jun 2014 05:04 PM |
| I suggest you read the locked forum thread on SH again. |
|
|
| Report Abuse |
|
|
Cheeso135
|
  |
| Joined: 13 Apr 2013 |
| Total Posts: 2016 |
|
| |
|
|
| 20 Jun 2014 05:17 PM |
| The thread at the top of this forum. |
|
|
| Report Abuse |
|
|
Cheeso135
|
  |
| Joined: 13 Apr 2013 |
| Total Posts: 2016 |
|
|
| 20 Jun 2014 05:20 PM |
| Yeah lol. I found it. Not a problem with the script. I have the game breaking when there is an error with the script. The model just does not take damage. Is there a (take damage) script or something that I can insert? |
|
|
| Report Abuse |
|
|
Cheeso135
|
  |
| Joined: 13 Apr 2013 |
| Total Posts: 2016 |
|
|
| 20 Jun 2014 05:31 PM |
| I just looked over all the scripts in the model….found nothing about damage to begin with but…..it is not like it has 1 billion health or has no humanoid function….I mean, I hit it with a sword and it loses no damage…..PLease someone help!!!! |
|
|
| Report Abuse |
|
|
Cheeso135
|
  |
| Joined: 13 Apr 2013 |
| Total Posts: 2016 |
|
|
| 20 Jun 2014 05:41 PM |
| Should I use an OnTouch take damage script? |
|
|
| Report Abuse |
|
|
Aisoc
|
  |
| Joined: 08 Jun 2013 |
| Total Posts: 412 |
|
|
| 20 Jun 2014 05:43 PM |
| well first you should understand to zombies work than look for linked sword my suggestion |
|
|
| Report Abuse |
|
|
|
| 20 Jun 2014 05:43 PM |
| The problem is likely with the sword. It is looking for a Humanoid with a specific name that isn't matching with what your model has. |
|
|
| Report Abuse |
|
|
Cheeso135
|
  |
| Joined: 13 Apr 2013 |
| Total Posts: 2016 |
|
|
| 20 Jun 2014 05:46 PM |
Hmmm. I just tried to use an OnTouch script but it did not work Here:
function onTouched(LinkedSword) local h = part.Parent:findFirstChild("Humanoid") if h~=nil then h.Health = h.Health -5 end end
script.Parent.Touched:connect(onTouched)
It says that the last line is invalid because OnTouched is part of the model. I tried changing it to Torso (part of the model) but it did not work…. |
|
|
| Report Abuse |
|
|
Cheeso135
|
  |
| Joined: 13 Apr 2013 |
| Total Posts: 2016 |
|
|
| 20 Jun 2014 05:47 PM |
| I made the model not have a name. I just put a space and hit enter. Do I have to name it? |
|
|
| Report Abuse |
|
|
Aisoc
|
  |
| Joined: 08 Jun 2013 |
| Total Posts: 412 |
|
|
| 20 Jun 2014 05:48 PM |
i am not sure about this its true or not h.Health = h.Health -5
try to add wait() to first line |
|
|
| Report Abuse |
|
|
|
| 20 Jun 2014 05:48 PM |
| The model, no. The Humanoid has to match whatever you used in the script, in this case "Humanoid". |
|
|
| Report Abuse |
|
|
Cheeso135
|
  |
| Joined: 13 Apr 2013 |
| Total Posts: 2016 |
|
|
| 20 Jun 2014 05:56 PM |
| YESSSS THANK YOU KNIGHTMARE AND THANKS EVERYONE ELSE!!! |
|
|
| Report Abuse |
|
|