Advertisement
Guest User

Untitled

a guest
Jan 27th, 2020
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.46 KB | None | 0 0
  1.  
  2. debounce = false
  3. script.Parent.Activated:connect(function(activetee)
  4.     if debounce == false then
  5.         debounce = true
  6.         local pchar = script.Parent.Parent
  7.     local defsped = 16
  8.     local defjump = 50
  9.     local anim = script.Animation
  10.     local animfrick = anim.AnimationId
  11.     local phum = pchar.Humanoid:LoadAnimation(anim)
  12.     phum:Play()
  13.     pchar.RightUpperArm.CanCollide = false
  14.     pchar.RightLowerArm.CanCollide = false
  15.     pchar.RightHand.CanCollide = false
  16.     pchar.HumanoidRootPart.CanCollide = false
  17.     pchar.Humanoid.WalkSpeed = 8
  18.     pchar.Humanoid.JumpPower = 8
  19.     wait(0.3)
  20.     pchar.RightUpperArm.CanCollide = true
  21.     pchar.RightLowerArm.CanCollide = true
  22.     pchar.RightHand.CanCollide = true
  23.     pchar.HumanoidRootPart.CanCollide = true
  24.     pchar.Humanoid.WalkSpeed = defsped
  25.     pchar.Humanoid.JumpPower = defjump
  26.     debounce2 = false
  27.    
  28.    
  29.    
  30.     script.Parent.Handle.Touched:connect(function(hit)
  31.         if debounce2 == false then
  32.             debounce2 = true
  33.             if hit.Name == pchar.Name then
  34.            
  35.            
  36.             else
  37.                 local crit = math.random(1,5)
  38.                 if crit == 1 then
  39.                     local hum1 = hit.Parent:FindFirstChild("Humanoid")
  40.                 if hum1 then
  41.                     hum1:TakeDamage(15)
  42.                 else
  43.                    
  44.                 end
  45.                    
  46.                 else
  47.                     local hum1 = hit.Parent:FindFirstChild("Humanoid")
  48.                 if hum1 then
  49.                     hum1:TakeDamage(5)
  50.                 else
  51.                    
  52.                 end
  53.                 end
  54.                
  55.                
  56.                
  57.                    
  58.                
  59.                
  60.                
  61.  
  62.                    
  63.                 end
  64.            
  65.             wait(0.7)
  66.             debounce2 = false
  67.         end
  68.        
  69.     end)
  70.        
  71.         wait(0.7)
  72.         debounce = false
  73.     end
  74. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement