Advertisement
Guest User

Untitled

a guest
Mar 29th, 2020
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.35 KB | None | 0 0
  1. local _C = {
  2. --] Basic Configuration
  3. ["MaxDamage"] = 2643;
  4. ["MinDamage"] = 6235;
  5. ["Cooldown"] = 1;
  6. ["Cost"] = 0;
  7. --] Advanced
  8. ["HumanoidToKill"] = ("Enemy")
  9. }
  10.  
  11. return _C
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19. ---------------------------------------------------------------------------------------------------------------------------------------------------
  20.  
  21.  
  22.  
  23.  
  24.  
  25. if (j and (j.Part0 == Handle or j.Part1 == Handle)) then
  26. if (not enemy) then return end
  27. game.ReplicatedStorage.GameRemotes.DamageEvent:FireServer(hit,enemy,Tool)
  28. end
  29. wait(_M.Cooldown)
  30. debounce = false
  31. end
  32. end
  33. end
  34. end
  35.  
  36. function onActivated()
  37. if (not Tool.Enabled) then return end
  38. Tool.Enabled = false
  39. local chr = Tool.Parent
  40. local hum = chr:FindFirstChild("Humanoid")
  41. local anim = hum:LoadAnimation(script.Parent.Slash)
  42. if (hum == nil) then return end
  43. SlashSound:Play()
  44. anim:Play()
  45. script.Parent.Unequipped:Connect(function()
  46. anim:Stop()
  47. end)
  48. wait(_M.Cooldown)
  49. Tool.Enabled = true
  50. end
  51.  
  52.  
  53. function onEquipped()
  54. if (not Tool) then return end
  55. if (not Handle) then return end
  56. if Handle.UnsheathSound.IsPlaying == false then
  57. Handle.UnsheathSound:Play()
  58. end
  59. end
  60.  
  61. function onUnequipped()
  62. if (not Tool) then return end
  63. if (not Handle) then return end
  64. Handle.UnsheathSound:Stop()
  65. end
  66.  
  67. function checkValue()
  68. if valueCooldown == false then
  69. valueCooldown = true
  70. script.CanDamage.Value = true
  71. wait(_M.Cooldown)
  72. wait()
  73. script.CanDamage.Value = false
  74. valueCooldown = false
  75. end
  76. end
  77.  
  78. script.Parent.Activated:Connect(onActivated)
  79. script.Parent.Activated:Connect(checkValue)
  80. script.Parent.Equipped:Connect(onEquipped)
  81. script.Parent.Unequipped:Connect(onUnequipped)
  82. connection = Handle.Touched:Connect(SwordCore)
  83. ------------------------------------------------------------------
  84. function weld()
  85. local parts,last = {}
  86. local function scan(parent)
  87. for _,v in pairs(parent:GetChildren()) do
  88. if (v:IsA("BasePart")) then
  89. if (last) then
  90. local w = Instance.new("Weld")
  91. w.Name = ("%s_Weld"):format(v.Name)
  92. w.Part0,w.Part1 = last,v
  93. w.C0 = last.CFrame:inverse()
  94. w.C1 = v.CFrame:inverse()
  95. w.Parent = last
  96. end
  97. last = v
  98. table.insert(parts,v)
  99. end
  100. scan(v)
  101. end
  102. end
  103. scan(script.Parent)
  104. for _,v in pairs(parts) do
  105. v.Anchored = false
  106. end
  107. end
  108.  
  109. weld()
  110. script:Remove()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement