New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

I successfully played the first two punches in order but can someone explain how to fix the kicks?

Asked by 10 days ago

Before i added if Alternate2 and below everything else worked fine ( My character could do a left punch on one click and a right punch on the second click). But, I wanted it to do the same thing so after the right punch on the third click it would do a kick and on the fourth it would do another kick. Instead when I added Alternate2 and below it's like the script chose only one kick and one punch to play on my first two clicks. How can i make it so that it goes (1st click - left punch, 2nd click - Right Punch, 3rd click - nutkick, 4th click - spinkick?

local Player = game.Players.LocalPlayer local Mouse = Player:GetMouse() local Punch1 = script.Parent:WaitForChild("Punch1") local Punch2 = script.Parent:WaitForChild("Punch2") local nutkick = script.Parent:WaitForChild("nutkick") local spinkick = script.Parent:WaitForChild("spinkick") local Alternate = false local Alternate2 = false local Enabled = true Mouse.Button1Down:Connect(function() local leftpunch = Player.Character.Humanoid:LoadAnimation(Punch1) local rightpunch = Player.Character.Humanoid:LoadAnimation(Punch2) local nutkicked = Player.Character.Humanoid:LoadAnimation(nutkick) local spinkicked = Player.Character.Humanoid:LoadAnimation(spinkick) if Enabled == false then return end Enabled = false

if Alternate then
    leftpunch:Play()
else
    rightpunch:Play()
end
if Alternate2 then
    nutkicked:Play()
else
    spinkicked:Play()
end
Alternate = not Alternate
Alternate2 = not Alternate2



wait(.5)
Enabled = true

end)

Answer this question