--Put this in StarterPlayer, StarterCharacterScripts



local human = script.Parent:WaitForChild("Humanoid")

local AttackArm = true 

local canattack = true 

game:GetService("UserInputService").InputBegan:connect(function(input, gamepor)
	if (input.KeyCode == Enum.KeyCode.X or input.KeyCode == Enum.KeyCode.ButtonY) and canattack then 
		canattack = false 
		script.RemoteEvent:FireServer(AttackArm) 
		human:LoadAnimation(AttackArm and script.R or script.L):Play()
		wait(0.6) 
		AttackArm = not AttackArm 
		canattack = true 
	end	
end)
