lawl60ftw
|
  |
| Joined: 30 May 2009 |
| Total Posts: 3973 |
|
|
| 25 Oct 2012 07:37 AM |
I don't really know how to explain this, but I made a script that displays the sword hits above the enemy's head. The sword script is doing multiple hits because the sword is searching for any part of the enemy, whether it be the arm/torso/head and deals damage per separate part of the body. Is there a way to make the script search for the torso only or after dealing damage, the sword's damage changes to 0 for 1 second?
Example: If I slash the center of an enemy, it'll go through the head and the body, meaning it deals 3 sets of damage. Going through the head, going through the body and then going back up through the head again. If it targets the torso, it will skip the damage for the head and only deal 1 set of damage. Can somebody please explain searching for a certain part to me?
Aim: sword only damages if it hits a "Monster" (Humanoid name) Torso.
Here's the section of the script that I think it needs to be added to:
function blow(hit) local humanoid = hit.Parent:findFirstChild("Monster") local vCharacter = Tool.Parent local vPlayer = game.Players:playerFromCharacter(vCharacter) local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by |
|
|
| Report Abuse |
|
Trioxide
|
  |
| Joined: 29 Mar 2011 |
| Total Posts: 32902 |
|
| |
lawl60ftw
|
  |
| Joined: 30 May 2009 |
| Total Posts: 3973 |
|
|
| 25 Oct 2012 09:39 AM |
Very much appreciated, I was stuck on this for a while.
Thanks, truly. |
|
|
| Report Abuse |
|