Hasli4

RBLX. AttackEnemy

Jan 9th, 2026
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.82 KB | None | 0 0
  1. local larm = script.Parent:FindFirstChild("LeftHand")
  2. local sword = script.Parent:FindFirstChild("ClassicSword")
  3. local Attack_Speed = script.Parent.AttackSpeed
  4.     function dmg_hand(hit)
  5.     if hit.Parent ~= nil then
  6.         local hum = hit.Parent:findFirstChild("Humanoid")
  7.         if hum ~= nil then
  8.             hum.Health = hum.Health - 20
  9.         end
  10.         script.Enabled=false
  11.         wait(Attack_Speed.Value)
  12.         script.Enabled=true
  13.     end
  14. end
  15. function dmg_sword(hit)
  16.     if hit.Parent ~= nil then
  17.         local hum = hit.Parent:findFirstChild("Humanoid")
  18.         if hum ~= nil then
  19.             hum.Health = hum.Health - 20
  20.         end
  21.         script.Enabled=false
  22.         wait(Attack_Speed.Value)
  23.         script.Enabled=true
  24.     end
  25. end
  26.  
  27. larm.Touched:connect(dmg_hand)
  28. sword.Touched:connect(dmg_sword)
Advertisement
Add Comment
Please, Sign In to add comment