So basically, I want it so that when you press q you punch once with one hand, then the second time you press q it punches with other hand. I've gotten answers on another question, but I cannot add it to this type of script can someone help me? How do I add an If statement to a mouse.Keydown ? Is there any syntax mistakes?
local player = game.Players.LocalPlayer
repeat wait() until player.Character.Humanoid
local humanoid = player.Character.Humanoid
local mouse = player:GetMouse()
donefirstpunch = false
local anim = Instance.new("Animation")
anim.AnimationId = "http://www.roblox.com/asset/?id=892155490"
local anim1 = Instance.new("Animation")
anim.AnimationId = "http://www.roblox.com/asset/?id=897125858"
mouse.KeyDown:connect(function(key)
if key == "q" then
local playAnim = humanoid:LoadAnimation(anim)
playAnim:Play()
local donefirstpunch = true
end
end)
if donefirstpunch == true then
mouse.KeyDown:connect(function(key)
if key == "q" then
local playAnim1 = humanoid:LoadAnimation(anim1)
playAnim1: Play()
donefirstpunch = false
end
end)
end****
