Riley_Huntley

Untitled

Nov 28th, 2015
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.92 KB | None | 0 0
  1. function blow(hit)
  2.     if (hit.Parent == nil) then return end -- happens when bullet hits sword
  3.  
  4.     local humanoid = hit.Parent:findFirstChild("Humanoid")
  5.     local vCharacter = Tool.Parent
  6.     local vPlayer = game.Players:playerFromCharacter(vCharacter)
  7.     local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
  8.     if humanoid~=nil and humanoid ~= hum and hum ~= nil then
  9.         -- final check, make sure sword is in-hand
  10.  
  11.         local right_arm = vCharacter:FindFirstChild("Right Arm")
  12.         if (right_arm ~= nil) then
  13.             local joint = right_arm:FindFirstChild("RightGrip")
  14.             if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
  15.                 tagHumanoid(humanoid, vPlayer)
  16.                 if humanoid.TeamColor==BrickColor.new("Bright red") or humanoid.TeamColor==BrickColor.new("Bright blue") then return end
  17.                 else
  18.                 humanoid:TakeDamage(damage)
  19.                 wait(1)
  20.                 untagHumanoid(humanoid)
  21.             end
  22.         end
  23.  
  24.  
  25.     end
  26. end
Advertisement
Add Comment
Please, Sign In to add comment