Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tool = script.Parent
- local Anim1 = Instance.new("Animation")
- local Anim2 = Instance.new("Animation")
- local Anim3 = Instance.new("Animation")
- local Anim4 = Instance.new("Animation")
- Anim1.AnimationId = "rbxassetid://04707691579"
- Anim2.AnimationId = "rbxassetid://04707693196"
- Anim3.AnimationId = "rbxassetid://04707694337"
- Anim4.AnimationId = "rbxassetid://04707695605"
- local didpunch1 = false
- local didpunch2 = true
- local didkick1 = true
- local didkick2 = true
- local cooldown1 = 1.5
- local cooldown2 = 5 - cooldown1
- function attack(player)
- local Char = tool.Parent
- local Owner = tool:WaitForChild("Owner")
- local LAnim1 = Char.Humanoid:LoadAnimation(Anim1)
- local LAnim2 = Char.Humanoid:LoadAnimation(Anim2)
- local LAnim3 = Char.Humanoid:LoadAnimation(Anim3)
- local LAnim4 = Char.Humanoid:LoadAnimation(Anim4)
- Owner.Value = (tool.Parent.Name)
- if didpunch1 == false then
- local Damagescript1 = game.ServerStorage.DamageScript:Clone()
- Damagescript1.Parent = tool.Parent["Right Arm"]
- LAnim1:Play()
- didpunch1 = true
- wait(cooldown1)
- Damagescript1:Destroy()
- didpunch2 = false
- else
- if didpunch2 == false then
- local Damagescript2 = game.ServerStorage.DamageScript:Clone()
- Damagescript2.Parent = tool.Parent["Left Arm"]
- LAnim2:Play()
- didpunch2 = true
- wait(cooldown1)
- Damagescript2:Destroy()
- didkick1 = false
- else
- if didkick1 == false then
- local Damagescript3 = game.ServerStorage.DamageScript:Clone()
- Damagescript3.Parent = tool.Parent["Right Leg"]
- LAnim3:Play()
- didkick1 = true
- wait(cooldown1)
- Damagescript3:Destroy()
- didkick2 = false
- else
- if didpunch1 == false then
- local Damagescript4 = game.ServerStorage.DamageScript:Clone()
- Damagescript4.Parent = tool.Parent["Right Leg"]
- LAnim4:Play()
- didkick2 = true
- wait(cooldown1)
- Damagescript4:Destroy()
- wait(cooldown2)
- didpunch1 = false
- end
- end
- end
- end
- end
- script.Parent.Activated:Connect(attack)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement