--functions

function pose1()
	local player = game.Players.LocalPlayer
	if (player == nil) then return end
	char = player.Character
	Rshoulder = char.Torso:findFirstChild("Right Shoulder")
	Lshoulder = char.Torso:findFirstChild("Left Shoulder")
	Rhip = char.Torso:findFirstChild("Right Hip")
	Lhip = char.Torso:findFirstChild("Left Hip")
	if (Rshoulder ~= nil) then Rshoulder.DesiredAngle = 0 end
	if (Lshoulder ~= nil) then Lshoulder.DesiredAngle = 0 end
	if (Rhip ~= nil) then Rhip.DesiredAngle = 0 end
	if (Lhip ~= nil) then Lhip.DesiredAngle = 0 end
end

function noanimate()
	local player = game.Players.LocalPlayer
	if (player == nil) then return end
	char = player.Character
	local Anim = char:findFirstChild("Animate")
	if (Anim ~= nil) then
		Anim.Parent = player
	end
end

function animate()
	local player = game.Players.LocalPlayer
	if (player == nil) then return end
	char = player.Character
	local Anim = player:findFirstChild("Animate")
	if (Anim ~= nil) then
		Anim.Parent = char
		wait()
		Rshoulder = char.Torso:findFirstChild("Right Shoulder")
		Lshoulder = char.Torso:findFirstChild("Left Shoulder")
		Rhip = char.Torso:findFirstChild("Right Hip")
		Lhip = char.Torso:findFirstChild("Left Hip")
		if (Rshoulder ~= nil) then
			Rshoulder.Parent = nil
			Rshoulder.Parent = char.Torso
		end
		if (Lshoulder ~= nil) then
			 Lshoulder.Parent = nil
			 Lshoulder.Parent = char.Torso
		end
		if (Rhip ~= nil) then
			 Rhip.Parent = nil
			 Rhip.Parent = char.Torso
		end
		if (Lhip ~= nil) then
			 Lhip.Parent = nil
			 Lhip.Parent = char.Torso end
		end
end

function FalconPUUUNCH(mouse)
	local player = game.Players.LocalPlayer
	if (player == nil) then return end
	char = player.Character
	if (punchload == false) then
		Rarm = char:findFirstChild("Right Arm")
		Torso = char.Torso
		Rshoulder = Torso:findFirstChild("Right Shoulder")
		if (Rarm ~= nil) and (Rshoulder ~= nil) then
			punchload = true
			mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
			noanimate()
			pose1()
			Rshoulder.MaxVelocity = 1
			Rshoulder.DesiredAngle = 0
			wait(0.5)
			hurtc = hurt:clone()
			hurtc.Disabled = false
			hurtc.Parent = Rarm
			hurtc.Owner.Value = player.Name
			Rshoulder.DesiredAngle = 2
			wait(0.1)
			Rshoulder.MaxVelocity = 0.1
			wait(1)
			while hurtc.Enabled.Value == true do
				wait(0.1)
			end
			hurtc:remove()
			animate()
			punchload = false
			mouse.Icon = "rbxasset://textures\\GunCursor.png"
		end
	end
end 
