Advertisement
Guest User

Untitled

a guest
Jul 17th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.59 KB | None | 0 0
  1. local BasicAttack = game:GetService("ReplicatedStorage").RemoteFunctions:FindFirstChild("WeaponRemotes").ZangetsuRemotes["BasicAttack"]
  2. local Assets = game:GetService("ReplicatedFirst"):WaitForChild("Assets")
  3.  
  4. BasicAttack.OnServerEvent:Connect(function(player)
  5. player.Character.holder.Clashing.Value = true
  6. ----------------------------------------------------Variables
  7. local Sword = player.Character.Tool.Blade
  8. local clash = Instance.new('BodyVelocity')
  9. local root = player.Character.HumanoidRootPart
  10. local hitbox = Instance.new("Part")
  11. local name = player.Name
  12. local folder = game:GetService("ReplicatedStorage"):FindFirstChild(name)
  13. local Kendo = folder.Stats.Kendo
  14. local debounce = {};
  15. ----------------------------------------------------Hitbox
  16. hitbox.Name = "Hitbox"
  17. hitbox.Parent = game.Workspace
  18. hitbox.CFrame = Sword.CFrame
  19. hitbox.CanCollide = false
  20. hitbox.Size = Vector3.new(10,2,1)
  21. hitbox.Transparency = 0.5
  22. hitbox.BrickColor = BrickColor.new("Really red")
  23. ---------------------------------------------------Welding
  24. local w1 = Instance.new("Weld", Sword)
  25. w1.Part0 = Sword
  26. w1.Part1 = hitbox
  27. w1.C0 = CFrame.Angles(0,0,5)
  28. w1.C1 = CFrame.new(0,-0.3,0)
  29. --------------------------------------------------Damage
  30. hitbox.Touched:Connect(function(hit)
  31. local dmg = math.floor(Kendo.Value/ 1.15 + math.random(1,5))
  32. local enemyWeapon = hit.Parent:FindFirstChild('Hitbox')
  33. local opponent = hit.Parent:FindFirstChild("Humanoid")
  34. local hostileWeapon = hit.Name
  35. if opponent ~= player.Character:FindFirstChild("Humanoid") and hit.Parent.Name ~= "Hitbox" or hit.Parent.Name ~= "Blade" then
  36.  
  37. opponent:TakeDamage(dmg)
  38. ------------------------------------------------------
  39. -----------------[Text/Gui and debounce]---------------------------
  40. local effect = Instance.new("BillboardGui", opponent.Parent.Head)
  41. effect.Size = UDim2.new(1,0,1,0)
  42. wait()
  43. local text = Instance.new("TextBox")
  44. text.Parent = effect
  45. text.TextSize = 60
  46. text.TextColor3 = Color3.new(255,255,255)
  47. text.TextStrokeColor3 = Color3.new(95,0,0)
  48. text.TextStrokeTransparency = 0
  49. text.Font = "Cartoon"
  50. text.BackgroundTransparency = 1
  51. text.Size = UDim2.new(1,0,1,0)
  52.  
  53.  
  54.  
  55. text.Text = dmg
  56. wait(0.5)
  57. effect:remove()
  58.  
  59.  
  60. elseif hostileWeapon == 'Hitbox' or hostileWeapon == "Blade" then
  61. clash.Parent = root
  62. clash.maxForce = Vector3.new(1e8,1e8,1e8)
  63. clash.Velocity = root.CFrame.lookVector*-60
  64. wait()
  65. clash.Velocity = Vector3.new(0,0,0)
  66. clash:remove()
  67. else
  68. print(hit.Name)
  69.  
  70.  
  71. end
  72. end)
  73. wait(0.85)
  74. hitbox:remove()
  75. wait(0.5)
  76. player.Character.holder.Clashing.Value = false
  77. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement