Advertisement
HowToRoblox

SlashTrailScript

Dec 22nd, 2019
3,819
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.53 KB | None | 0 0
  1. local CanAttack = true
  2.  
  3. local Sound = script.Parent:WaitForChild("SwordSwing")
  4.  
  5.  
  6. local trail = script.Parent.Handle.SlashTrail
  7.  
  8. script.Parent.Activated:Connect(function()
  9.  
  10.     local AttackAnim = script.Parent.Parent.Humanoid:LoadAnimation(script.Attack)
  11.    
  12.    
  13.     if CanAttack == true then
  14.    
  15.         AttackAnim:Play()
  16.        
  17.         trail.Enabled = true
  18.    
  19.         CanAttack = false
  20.        
  21.         Sound:Play()
  22.    
  23.         wait(1)
  24.        
  25.         AttackAnim:Stop()
  26.        
  27.         trail.Enabled = false
  28.        
  29.         CanAttack = true
  30.        
  31.         script.Parent.CanDamage.Value = true   
  32.     end
  33. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement