Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tool = script.Parent
- local handle = tool:WaitForChild("Handle")
- local slash = script:WaitForChild("slash")
- local debounce = false
- local playersHit = {}
- local up = game.Workspace.SwordFF.Sword.Up
- --Anim
- tool.Activated:Connect(function()
- if debounce == false then
- debounce = true
- local humanoid = tool.Parent:WaitForChild("Humanoid")
- local AnimTrack = humanoid:LoadAnimation(slash)
- AnimTrack:Play(wait(AnimTrack))
- wait(1)
- debounce = false
- end
- end)
- --Damage
- up.Touched:Connect(function(Hit)
- if Hit.Parent:FindFirstChild("Humanoid") and Hit.Parent ~= tool.Parent then
- if debounce == true and playersHit[Hit.Parent] == nil then
- Hit.Parent:FindFirstChild("Humanoid"):TakeDamage(25)
- playersHit[Hit.Parent] = true
- wait(1)
- playersHit[Hit.Parent] = nil
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement