Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Attack_Damage = {
- Normal_Damage = 0, -- Put Damage Value Here
- Combo_2_Damage = 0, -- Put Damage Value Here
- Combo_3_Damage = 0, -- Put Damage Value Here
- }
- Animation = {
- Idle = 0, -- Idle Anim id here
- Anim_1 = 0, -- Normall Attack Anim id here
- Anim_2 = 0, -- Combo 2 Attack Anim id here
- Anim_3 = 0, -- Combo 3 Attack Anim id here
- }
- Sounds = {
- Swing1_Sound = 0, -- Sound Id here
- Swing2_Sound = 0, -- Sound Id here
- Idle_Sound = 0, --Sound Id here
- }
- db = true
- function Hit(hit)
- humanoid = hit.Parent:WaitForChild("Humanoid") -- Humanoid
- end
- function Attack()
- local Damage = Attack_Damage.Normal_Damage -- Defualt Damage
- local Sound1 = Sounds.Swing1_Sound:Play() -- Defuat Sound
- if db == true then
- db = false
- if humanoid then
- humanoid.Health = humanoid.Health - 10
- end
- end
- end
- function Combo2()
- local Damage = Attack_Damage.Combo_2_Damage
- local Sound2 = Sounds.Swing2_Sound
- if db == true then
- db = false
- if humanoid then
- humanoid.Health = humanoid.Health - 20
- end
- end
- end
- function Combo3()
- local Damage = Attack_Damage.Combo_3_Damage
- local Sound3 = Sounds.Swing2_Sound
- if db == true then
- db = false
- if humanoid then
- humanoid.Health = humanoid.Health - 15
- end
- end
- end
- local Tool = script.Parent
- local LastAttack = 0
- function Activated()
- if not Tool.Enabled or not Tool.Equipped then
- return
- end
- Tool.Enabled = false -- Keep it false
- local Tk = game:GetService("RunService").Stepped:Wait()
- if (Tk - LastAttack < 0.2) then
- Combo2() -- The Attack you want it to do if it has attacked
- else
- Attack() -- Defualt Attack
- end
- LastAttack = Tk
- local Damage = Attack_Damage.Normal_Damage
- local Defualt_Anim = Animation.Anim_1 -- Defualt Animation
- local Combo2_Anim = Animation.Anim_2 -- Combo2 Animation
- Tool.Enabled = true
- end
- function Equipped()
- local Character = Tool.Parent
- local Player = game.Players:GetPlayerFromCharacter(Character)
- local Humanoid = Character:FindFirstChildOfClass("Humanoid")
- local Torso = Character:FindFirstChild("Torso") or Character:FindFirstChild("HumanoidRootPart")
- if humanoid.Health == 0 then
- return
- end
- local db = true
- Sounds.Idle_Sound:Play()
- end
- Tool.Activated:Connect(Activated)
- Tool.Equipped:Connect(Equipped)
- Connection = Tool.Blade.Touched:Connect(Hit) -- Make sure you have blade in your Sword
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement