local uis = game:GetService("UserInputService") local last = os.clock() local combatEvent = game:GetService("ReplicatedStorage").combatEvent local specEvent = game:GetService("ReplicatedStorage").Spec local combo = 0 local cd = false local db = false local blockCd = false local hitcd = false local begin = false local player = game:GetService("Players").LocalPlayer local char = player.Character or player.CharacterAdded:Wait() local hum = char:WaitForChild("Humanoid") local animator = hum.Animator local blocking = false local stunned = char:WaitForChild("Stunned").Value local animationEvent = game:GetService("ReplicatedStorage").animationStop local blockEvent = game:GetService("ReplicatedStorage").blockEvent local stunEvent = game:GetService("ReplicatedStorage").stunPlay local runService = game:GetService("RunService") local m1 = false local going = false specEvent:FireServer("NoSpec", 100, 16) local blockBreak = Instance.new("Animation") blockBreak.AnimationId = "rbxassetid://14106112575" local blockBreakAnim = animator:LoadAnimation(blockBreak) local stun1 = Instance.new("Animation") stun1.AnimationId = "rbxassetid://14110343023" local stun1Anim = animator:LoadAnimation(stun1) local stun2 = Instance.new("Animation") stun2.AnimationId = "rbxassetid://14110344494" local stun2Anim = animator:LoadAnimation(stun2) local stun3 = Instance.new("Animation") stun3.AnimationId = "rbxassetid://14110348868" local stun3Anim = animator:LoadAnimation(stun3) local stun4 = Instance.new("Animation") stun4.AnimationId = "rbxassetid://14110350113" local stun4Anim = animator:LoadAnimation(stun4) local blocking = Instance.new("Animation") blocking.AnimationId = "rbxassetid://14110339708" local blockingAnim = animator:LoadAnimation(blocking) local firstHit = Instance.new("Animation") firstHit.AnimationId = "rbxassetid://14085413219" local firstHitAnim = animator:LoadAnimation(firstHit) local secondHit = Instance.new("Animation") secondHit.AnimationId = "rbxassetid://14085415055" local secondHitAnim = animator:LoadAnimation(secondHit) local thirdHit = Instance.new("Animation") thirdHit.AnimationId = "rbxassetid://14085416462" local thirdHitAnim = animator:LoadAnimation(thirdHit) local fourthHit = Instance.new("Animation") fourthHit.AnimationId = "rbxassetid://14085418080" local fourthHitAnim = animator:LoadAnimation(fourthHit) uis.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 then m1 = true end end) uis.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 then m1 = false end end) runService.RenderStepped:Connect(function() if m1 and not char:FindFirstChild("Patito") then if char:WaitForChild("Stunned").Value then return end if blocking then return end if cd then return end if combo == 0 then last = os.clock() end if os.clock() - last < 0.65 then if hitcd then return end hitcd = true task.delay(0.5, function() hitcd = false end) if combo < 4 then last = os.clock() combo += 1 --print("combo X"..combo) combatEvent:FireServer(combo) going = true if combo == 1 then firstHitAnim:Play() end if combo == 2 then secondHitAnim:Play() end if combo == 3 then thirdHitAnim:Play() end if combo == 4 then fourthHitAnim:Play() end else going = false cd = true task.delay(1,function() cd = false combo = 0 end) end end end if cd then return end if os.clock() - last > 1 then combo = 0 end if os.clock() - last > 0.7 then going = false end end) runService.RenderStepped:Connect(function() if hitcd then return end if uis:IsKeyDown(Enum.KeyCode.F) then if char:WaitForChild("Stunned").Value then return end if going then return end if blockCd then return end db = false if not blockingAnim.IsPlaying then blockingAnim:Play() end blockEvent:FireServer(true) blocking = true else if not db then blockCd = true task.delay(0.4, function() blockCd = false end) db = true end blockingAnim:Stop() blockEvent:FireServer(false) blocking = false end end) stunEvent.OnClientEvent:Connect(function(value) if value then print("why") blockBreakAnim:Play() else if math.random(1, 4) == 1 then stun1Anim:Play() end if math.random(1, 4) == 2 then stun2Anim:Play() end if math.random(1,4) == 3 then stun3Anim:Play() end if math.random(1, 4) == 4 then stun4Anim:Play() end end end) animationEvent.OnClientEvent:Connect(function(value) if value then blockingAnim:Stop() else stun1Anim:Stop() stun2Anim:Stop() stun3Anim:Stop() stun4Anim:Stop() end end)