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
 

I want to change this sword script

Previous Thread :: Next Thread 
lawl60ftw is not online. 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 is not online. Trioxide
Joined: 29 Mar 2011
Total Posts: 32902
25 Oct 2012 09:02 AM
[ Content Deleted ]
Report Abuse
lawl60ftw is not online. 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
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