Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local combo = 0
- local timetoattack = .8
- local dmg = 6
- local range = 7
- script.Parent.OnServerEvent:Connect(function (plr, EnemBlocking)
- local Character = plr.Character
- local Humanoid = Character.Humanoid
- combo = combo + 1
- local leftpunch = Humanoid:LoadAnimation(script.leftpunch)
- local rightpunch = Humanoid:LoadAnimation(script.rightpunch)
- local leftuppercut = Humanoid:LoadAnimation(script.leftuppercut)
- local rightuppercut = Humanoid:LoadAnimation(script.leftuppercut)
- for i, v in pairs(game.Workspace:GetChildren()) do
- local m = (v: IsA("Model") and v) or nil
- if m and m:FindFirstChild("Humanoid") and m:FindFirstChild("HumanoidRootPart") and m ~= Character then
- if (Character.HumanoidRootPart.Position - m.HumanoidRootPart.Position).magnitude <= range then
- if combo == 1 or combo == 2 or combo == 3 or combo == 4 or combo == 5 then
- m.Humanoid:TakeDamage(dmg)
- end
- if combo == 1 then
- local punched1 = script.punched1:Clone()
- punched1.Parent = m.Head
- punched1:Play()
- game.Debris:addItem(punched1,.4)
- v.Humanoid:LoadAnimation(script.punchedright):Play()
- end
- if combo == 2 then
- local punched2 = script.punched2:Clone()
- punched2.Parent = m.Head
- punched2:Play()
- game.Debris:addItem(punched2,.4)
- m.Humanoid:LoadAnimation(script.punchedleft):Play()
- end
- if combo == 3 then
- local punched3 = script.punched3:Clone()
- punched3.Parent = m.Head
- punched3:Play()
- game.Debris:AddItem(punched3,.4)
- m.Humanoid:LoadAnimation(script.rightuppercutface):Play()
- end
- if combo == 4 then
- local punched4 = script.punched4:Clone()
- punched4.Parent = m.Head
- punched4:Play()
- game.Debris:AddItem(punched4,.4)
- m.Humanoid:LoadAnimation(script.leftuppercutpunched):Play()
- end
- end
- end
- end
- if combo == 1 then
- local leftpunch = Humanoid:LoadAnimation(script.leftpunch):Play()
- print ("p1")
- else if combo == 2 then
- local rightpunch = Humanoid:LoadAnimation(script.rightpunch):Play()
- print ("p2")
- spawn (function()
- wait(timetoattack)
- if combo == 2 then
- combo = 0
- end
- end)
- else if combo == 3 then
- local leftuppercut = Humanoid:LoadAnimation(script.leftuppercut):Play()
- print ("p3")
- spawn(function()
- wait(timetoattack)
- if combo == 3 then
- combo = 0
- end
- end)
- else if combo == 4 then
- local rightuppercut = Humanoid:LoadAnimation(script.rightuppercut):Play()
- print ("p4")
- spawn(function()
- wait(timetoattack)
- if combo == 4 then
- combo = 0
- end
- end)
- combo = 100
- wait(2)
- combo = 0
- end
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment