-------------------------------------





local legs = nil
local torso2 = nil
local welds2 = {}
local bodyforce = nil






function tagHumanoid(humanoid)
	local plr=game.Players:playerFromCharacter(sp.Parent)
	if plr~=nil then
		local tag=Instance.new("ObjectValue")
		tag.Value=plr
		tag.Name="creator"
		tag.Parent=humanoid
		delay(2,function()
			if tag~=nil then
				tag.Parent=nil
			end
		end)
	end
end


function ReloadSequence() 
weld33.C1 = CFrame.new(-0.75, -0.4, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0.02)
wait(.02)
weld33.C1 = CFrame.new(-0.75, -0.4, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0.04)
wait(.02)
weld33.C1 = CFrame.new(-0.75, -0.4, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0.06)
wait(.02)
weld33.C1 = CFrame.new(-0.75, -0.4, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0.08)
wait(.02)
weld33.C1 = CFrame.new(-0.75, -0.4, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0.1)
wait(.02)
weld33.C1 = CFrame.new(-0.75, -0.4, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-102), math.rad(-15), 0.12)
wait(.02)
weld33.C1 = CFrame.new(-0.75, -0.4, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-104), math.rad(-15), 0.14)
wait(.02)
weld33.C1 = CFrame.new(-0.75, -0.4, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-106), math.rad(-15), 0.16)
wait(.02)
weld33.C1 = CFrame.new(-0.75, -0.4, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-108), math.rad(-15), 0.18)
wait(.02)
weld33.C1 = CFrame.new(-0.75, -0.4, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-110), math.rad(-15), 0.2)
wait(.02)
weld55.C1 = CFrame.new(-0.25, 1.35, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(290), 0.1, math.rad(-90))
wait(.02)
weld55.C1 = CFrame.new(-0.15, 1.3, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(290), 0.2, math.rad(-90))
wait(.02)
weld55.C1 = CFrame.new(-0.15, 1.25, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(295), 0.2, math.rad(-90))
wait(.02)
weld55.C1 = CFrame.new(-0.15, 1.2, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(300), 0.2, math.rad(-90))
wait(.02)
weld55.C1 = CFrame.new(-0.15, 1.2, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(300), 0.1, math.rad(-90))
wait(.03)
weld55.C1 = CFrame.new(-0.15, 1.2, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(300), 0.05, math.rad(-90))
wait(.03)
weld55.C1 = CFrame.new(-0.15, 1.2, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(300), 0, math.rad(-90))
wait(.03)
weld55.C1 = CFrame.new(-0.15, 1.2, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(300), -0.05, math.rad(-90))
wait(.03)
weld55.C1 = CFrame.new(-0.15, 1.2, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(300), -0.1, math.rad(-90))
wait(.03)
weld55.C1 = CFrame.new(-0.15, 1.2, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(300), -0.15, math.rad(-90))
wait(.03)
weld55.C1 = CFrame.new(-0.15, 1.2, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(300), -0.2, math.rad(-90))
wait(.03)
weld55.C1 = CFrame.new(-0.15, 1.2, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(300), -0.25, math.rad(-90))
wait(.03)
weld55.C1 = CFrame.new(-0.15, 1.2, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(300), -0.3, math.rad(-90))
wait(.03)
weld55.C1 = CFrame.new(-0.15, 1.2, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(300), -0.35, math.rad(-90))
wait(.03)
weld55.C1 = CFrame.new(-0.15, 1.2, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(300), -0.3, math.rad(-90))
wait(.03)
weld55.C1 = CFrame.new(-0.15, 1.2, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(300), -0.35, math.rad(-90))
wait(.03)
weld55.C1 = CFrame.new(-0.15, 1.2, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(300), -0.4, math.rad(-90))
wait(.03)
weld55.C1 = CFrame.new(-0.15, 1.2, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(300), -0.45, math.rad(-90))
wait(.03)
weld55.C1 = CFrame.new(-0.15, 1.2, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(300), -0.5, math.rad(-90))
wait(.04)
weld55.C1 = CFrame.new(-0.15, 1.2, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(300), -0.45, math.rad(-90))
wait(.04)
weld55.C1 = CFrame.new(-0.15, 1.2, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(300), -0.4, math.rad(-90))
wait(.04)
weld55.C1 = CFrame.new(-0.15, 1.2, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(300), -0.3, math.rad(-90))
wait(.04)
weld55.C1 = CFrame.new(-0.15, 1.2, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(300), -0.2, math.rad(-90))
wait(.04)
weld55.C1 = CFrame.new(-0.15, 1.2, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(300), -0.1, math.rad(-90))
wait(.04)
weld55.C1 = CFrame.new(-0.15, 1.2, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(300), -0, math.rad(-90))
wait(.04)
weld55.C1 = CFrame.new(-0.15, 1.2, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(300), 0.1, math.rad(-90))
wait(.04)
weld55.C1 = CFrame.new(-0.15, 1.2, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(300), 0.2, math.rad(-90))
wait(.1)
weld55.C1 = CFrame.new(-0.35, 1, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(295), 0.075, math.rad(-90))
weld33.C1 = CFrame.new(-0.75, -0.4, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0.1)
wait(.1)
weld55.C1 = CFrame.new(-0.35, 0.8, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(290), 0.15, math.rad(-90))
weld33.C1 = CFrame.new(-0.75, -0.3, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0)
wait(.1)
weld55.C1 = CFrame.new(-0.35, 0.6, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(290), 0.225, math.rad(-90))
weld33.C1 = CFrame.new(-0.75, -0.2, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-85), math.rad(-15), 0)
wait(.1)
weld55.C1 = CFrame.new(-0.35, 0.4, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(300), 0.3, math.rad(-90))
weld33.C1 = CFrame.new(-0.75, -0.1, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-80), math.rad(-15), 0)
wait(.1)
weld55.C1 = CFrame.new(-0.35, 0.3, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(300), 0.375, math.rad(-90))
wait(.3)
weld55.C1 = CFrame.new(-0.35, 0.4, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(300), 0.3, math.rad(-90))
wait(.08)
weld33.C1 = CFrame.new(-0.75, -0.25, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-85), math.rad(-15), 0)
weld55.C1 = CFrame.new(-0.35, 0.7, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(295), 0.15, math.rad(-90))
wait(.08)
weld1.C1 = CFrame.new(-0.35, 1.2, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90))
weld2.C1 = CFrame.new(-0.75, -0.4, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0)
end

function reload(mouse)
	reloading=true
	mouse.Icon=ReloadCursor
	ReloadSequence()
	while sp.Ammo.Value<ClipSize and reloading and enabled do
		wait()
		if reloading then
			sp.Ammo.Value= 30
			check()
		else
			break
		end
	end
	check()
	mouse.Icon=Cursors[1]
	reloading=false
end

function onKeyDown(key,mouse)
	key=key:lower()
	if key=="r" and not reloading then
		Tool.Handle.Reload:Play()
		reload(mouse)
	elseif key == "f" and not reloading then
	if Tool.FireMode.Value <= 3 then
	Tool.FireMode.Value = Tool.FireMode.Value + 1
	else
	Tool.FireMode.Value = 1
	end
	elseif key == "g" and not reloading  then
	
	if Tool.Running.Value == false and not a and Tool.ZoomedIn.Value == false then
	sp.Parent.Humanoid.WalkSpeed = 21
	Tool.Running.Value = true
	weld1.C1 = CFrame.new(-0.249, 1.35, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(290), -0.1, math.rad(-90))
	weld2.C1 = CFrame.new(-1, -0.2, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-75), math.rad(-15), 0)
	wait(0.07)
	weld1.C1 = CFrame.new(-0.249, 1.35, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(290), -0.2, math.rad(-90))	-- Left Arm Movement(Up/Down,Forwards/Backwards,Left/Right) Rotation(Left/Right,Up/Down,Twist)
	weld2.C1 = CFrame.new(-1, -0.2, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-60), math.rad(-15), 0)	-- Right Arm Movement(Left/Right,Forwards/Backwards,Up/Down) Rotation(Up/Down,Left/Right,Twist)
	elseif Tool.Running.Value == true then
	Tool.Running.Value = false
	sp.Parent.Humanoid.WalkSpeed = 16
	weld1.C1 = CFrame.new(-0.249, 1.35, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(290), -0.1, math.rad(-90))
	weld2.C1 = CFrame.new(-1, -0.2, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-75), math.rad(-15), 0)
	wait(0.07)
	weld1.C1 = CFrame.new(-0.35, 1.4, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90))
	weld2.C1 = CFrame.new(-0.75, -0.4, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0)
	end
	
	end
end

function movecframe(p,pos)
	p.Parent=game.Lighting
	p.Position=pos
	p.Parent=game.Workspace
end


function fire(aim)
	sp.Handle.Fire:Play()
	barrel_1.Flash.Flash.Visible = true
	weld1.C1 = CFrame.new(-0.35, 1, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90))
	weld2.C1 = CFrame.new(-0.75, -0.6, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0)
	wait(0.02)
	weld1.C1 = CFrame.new(-0.35, 1.1, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90))
	weld2.C1 = CFrame.new(-0.75, -0.5, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0)
	wait(0.02)
	weld1.C1 = CFrame.new(-0.35, 1.2, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90))
	weld2.C1 = CFrame.new(-0.75, -0.4, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0)

	barrel_1.Flash.Flash.Visible = false
	Tool.Running.Value = false
	if Tool.ZoomedIn.Value == false then
	sp.Parent.Humanoid.WalkSpeed = 16
	end

	t=r.Stepped:wait()
	last6=last5
	last5=last4
	last4=last3
	last3=last2
	last2=last
	last=t
	local totalDist=0
	Lengthdist=-RayLength/.5
	startpoint=barrel_1.CFrame.p
	startpoint2 = barrel_2.CFrame.p
	if double then
		if doublemode == 1 then
			if UseDouble then
				startpoint=barrel_2.CFrame.p
			else
				startpoint=barrel_1.CFrame.p
			end
		end
	end
	local dir=(aim)-startpoint
	local dir2 = (aim)-startpoint2
	dir=dir.unit
	dir2 = dir2.unit
	local cfrm=CFrame.new(startpoint, dir+startpoint)
	local cfrm2 = CFrame.new(startpoint2,dir2+startpoint2)
	local hit,pos=raycursive(startpoint, cfrm.lookVector * 999)
	if hit~=nil then
		if hit.Parent.className == "Hat" then
			hit = hit.Parent
		elseif hit.Parent.className == "Tool" then
			hit = hit.Parent
		end
		
		local humanoid=hit.Parent:FindFirstChild("Humanoid")
		if humanoid~=nil and hit.Parent:findFirstChild("Downed") == nil then
			BaseDamage = 30
			local damage=math.random(BaseDamage-(BaseDamage*.25),BaseDamage+(BaseDamage*.25))
			if hit.Name=="Head" then
				damage=damage*2
			elseif hit.Name=="Torso" then
			damage=damage*2
			else
				damage=damage
			end
			if humanoid.Health>0 then
				
				local eplr=game.Players:playerFromCharacter(humanoid.Parent)
				local plr=game.Players:playerFromCharacter(sp.Parent)
				if eplr~=nil and plr~=nil then
					if eplr.TeamColor~=plr.TeamColor or eplr.Neutral or plr.Neutral then
						Mouse.Icon = "http://www.roblox.com/asset/?id=49170312"
						tagHumanoid(humanoid)
						humanoid:TakeDamage(damage)
					end
				else
					Mouse.Icon = "http://www.roblox.com/asset/?id=49170312"	
					tagHumanoid(humanoid)
					humanoid:TakeDamage(damage)
				end
			end
		end
		if (hit.Parent:findFirstChild("Hit")) then
			hit.Parent.Health.Value = hit.Parent.Health.Value - BaseDamage/3
		end

		if hit.Parent.Parent.Name == "HumVee" then
			hit.Parent.Parent.Health.Value = hit.Parent.Parent.Health.Value - BaseDamage
			Mouse.Icon = "http://www.roblox.com/asset/?id=49170312"
		elseif hit.Parent.Name == "HumVee" then
			hit.Parent.Health.Value = hit.Parent.Health.Value - BaseDamage
			Mouse.Icon = "http://www.roblox.com/asset/?id=49170312"
		elseif hit.Parent.Name == "Body" then
			hit.Parent.Parent.Health.Value = hit.Parent.Parent.Health.Value - BaseDamage
		elseif hit.Parent.Name == "Part" then
			hit.Parent.Parent.Health.Value = hit.Parent.Parent.Health.Value - BaseDamage
		elseif hit.Parent.Name == "Lights" then
			hit.Parent.Parent.Parent.Health.Value = hit.Parent.Parent.Parent.Health.Value - BaseDamage
		elseif hit.Parent.Name == "Rotors" then
			hit.Parent.Parent.Parent.Health.Value = hit.Parent.Parent.Parent.Health.Value - BaseDamage
		elseif hit.Parent.Name == "Seats" then
			hit.Parent.Parent.Parent.Health.Value = hit.Parent.Parent.Parent.Health.Value - BaseDamage
		elseif hit.Parent.Name == "Cockpit" then
		hit.Parent.Parent.Parent.Health.Value = hit.Parent.Parent.Parent.Health.Value - damage
		elseif hit.Parent.Name == "Front" then
		hit.Parent.Parent.Parent.Health.Value = hit.Parent.Parent.Parent.Health.Value - damage
		elseif hit.Parent.Name == "Middle" then
		hit.Parent.Parent.Parent.Health.Value = hit.Parent.Parent.Parent.Health.Value - damage
		elseif hit.Parent.Name == "Tail" then
		hit.Parent.Parent.Parent.Health.Value = hit.Parent.Parent.Parent.Health.Value - damage
		elseif hit.Parent.Name == "TailRotor" then
		hit.Parent.Parent.Parent.Health.Value = hit.Parent.Parent.Parent.Health.Value - damage
		elseif hit.Parent.Name == "Rotor" then
		hit.Parent.Parent.Parent.Health.Value = hit.Parent.Parent.Parent.Health.Value - damage
		elseif hit.Parent.Name == "NavLights" then
		hit.Parent.Parent.Parent.Health.Value = hit.Parent.Parent.Parent.Health.Value - damage
		end
		distance=(startpoint-pos).magnitude
		distance2 = (startpoint2-pos).magnitude
	else

	end
	local deb=game:FindFirstChild("Debris")
	if deb==nil then
		local debris=Instance.new("Debris")
		debris.Parent=game
	end
	check()
end

function onButton1Up(mouse)
	down=false
end

function onButton1Down(mouse)
	h=sp.Parent:FindFirstChild("Humanoid")
	if not enabled or reloading or down or h==nil then
		return
	end
	if sp.Ammo.Value>0 and h.Health>0 and h.Jump == false then
		--[[if sp.Ammo.Value<=0 then
			if not reloading then
				reload(mouse)
			end
			return
		end]]
		down=true
		enabled=false

		while down and h.Jump == false and h.Health>0 do
			if sp.Ammo.Value<=0 then
				break
			end
			
			if sp.FireMode.Value == 1 then
			if Tool.Pose.Value == 1 then
			Tool.Accuracy.Value = 0.01
			elseif Tool.Pose.Value == 2 then
			Tool.Accuracy.Value = 0.005
			elseif Tool.Pose.Value == 3 then
			Tool.Accuracy.Value = 0.0025
			end
			if Tool.ZoomedIn.Value == true then
			Tool.Accuracy.Value = Tool.Accuracy.Value - 0.25
			end
			automatic = true
			burst= false
			shot = false
			
			elseif sp.FireMode.Value == 2 then
			if Tool.Pose.Value == 1 then
			Tool.Accuracy.Value = 0.0025
			elseif Tool.Pose.Value == 2 then
			Tool.Accuracy.Value = 0.00125
			elseif Tool.Pose.Value == 3 then
			Tool.Accuracy.Value = 0.00625
			end
			if Tool.ZoomedIn.Value == true then
			Tool.Accuracy.Value = Tool.Accuracy.Value - 0.25
			end
			burst = true
			automatic = false
			shot = false
			
			elseif sp.FireMode.Value == 3 then
			if Tool.Pose.Value == 1 then
			Tool.Accuracy.Value = 0.00625
			elseif Tool.Pose.Value == 2 then
			Tool.Accuracy.Value = 0.0003125
			elseif Tool.Pose.Value == 3 then
			Tool.Accuracy.Value = 0.00015625
			end
			if Tool.ZoomedIn.Value == true then
			Tool.Accuracy.Value = 0
			end
			shot = true
			burst = false
			automatic = false
			elseif sp.FireMode.Value >= 4 then
			sp.FireMode.Value = 1
			end
		 

			if burst then
				local startpoint=barrel_1.CFrame.p
				local mag=(mouse.Hit.p-startpoint).magnitude
				local rndm=Vector3.new(math.random(-Tool.Accuracy.Value,Tool.Accuracy.Value), math.random(-Tool.Accuracy.Value,Tool.Accuracy.Value ),math.random(-Tool.Accuracy.Value,Tool.Accuracy.Value))
				fire(mouse.Hit.p+rndm)
				sp.Ammo.Value=sp.Ammo.Value-1
				if sp.Ammo.Value<=0 then
					break
				end
				wait(.02)
				local startpoint=barrel_1.CFrame.p
				local mag2=((mouse.Hit.p+rndm)-startpoint).magnitude
				local rndm2=Vector3.new(math.random(-Tool.Accuracy.Value,Tool.Accuracy.Value), math.random(-Tool.Accuracy.Value,Tool.Accuracy.Value ),math.random(-Tool.Accuracy.Value,Tool.Accuracy.Value))
				fire(mouse.Hit.p+rndm+rndm2)
				sp.Ammo.Value=sp.Ammo.Value-1
				if sp.Ammo.Value<=0 then
					break
				end
				wait(.02)
				fire(mouse.Hit.p+rndm+rndm2+rndm2)
				sp.Ammo.Value=sp.Ammo.Value-1
			elseif shot then
				sp.Ammo.Value=sp.Ammo.Value-1
				local startpoint=barrel_1.CFrame.p
				local mag=(mouse.Hit.p-startpoint).magnitude
				local rndm=Vector3.new(math.random(-Tool.Accuracy.Value,Tool.Accuracy.Value), math.random(-Tool.Accuracy.Value,Tool.Accuracy.Value ),math.random(-Tool.Accuracy.Value,Tool.Accuracy.Value))
				fire(mouse.Hit.p+rndm)
				wait(Firerate)
			elseif automatic then
				sp.Ammo.Value=sp.Ammo.Value-1
				local startpoint=barrel_1.CFrame.p
				local mag=(mouse.Hit.p-startpoint).magnitude
				local rndm=Vector3.new(math.random(-Tool.Accuracy.Value,Tool.Accuracy.Value), math.random(-Tool.Accuracy.Value,Tool.Accuracy.Value ),math.random(-Tool.Accuracy.Value,Tool.Accuracy.Value))
				fire(mouse.Hit.p+rndm)
			end
			wait(Firerate)
			if not automatic then
				break
			end
		end	
		enabled=true
	else
		wait()
	end
end

function onEquippedLocal(mouse)
wait(0.01)
arms = {Tool.Parent:FindFirstChild("Left Arm"), Tool.Parent:FindFirstChild("Right Arm")}
torso = Tool.Parent:FindFirstChild("Torso")
if arms ~= nil and torso ~= nil then
local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
if sh ~= nil then
local yes = true
if yes then
yes = false
sh[1].Part1 = nil
sh[2].Part1 = nil
falsearm1 = arms[1]:clone()
local mesh1 = Instance.new("BlockMesh")
mesh1.Scale = Vector3.new(.9,.9,.9)
mesh1.Parent = falsearm1
local armweld1 = Instance.new("Weld")
falsearm1.BrickColor = BrickColor.new(26)
falsearm1.Parent = Tool
armweld1.Parent = falsearm1
armweld1.Part0 = falsearm1
armweld1.Part1 = arms[1]
falsearm2 = arms[2]:clone()
local mesh2 = Instance.new("BlockMesh")
mesh2.Scale = Vector3.new(.9,.9,.9)
mesh2.Parent = falsearm2
local armweld2 = Instance.new("Weld")
falsearm2.BrickColor = BrickColor.new(26)
falsearm2.Parent = Tool
armweld2.Parent = falsearm2
armweld2.Part0 = falsearm2
armweld2.Part1 = arms[2]
 weld1 = Instance.new("Weld") -- left arm
weld55 = weld1
weld1.Part0 = torso
weld1.Parent = torso
weld1.Part1 = arms[1]
weld1.C1 = CFrame.new(-0.35, 1.2, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90))
welds[1] = weld1
 weld2 = Instance.new("Weld") -- right arm
weld33 = weld2
weld2.Part0 = torso
weld2.Parent = torso
weld2.Part1 = arms[2]
weld2.C1 = CFrame.new(-0.75, -0.4, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0)
welds[2] = weld2
end
else
end
else
end
	if mouse==nil then
		print("Mouse not found")
		return 
	end
	Mouse = mouse
	mouse.Icon=Cursors[1]
	mouse.KeyDown:connect(function(key) onKeyDown(key,mouse) end)
	mouse.Button1Down:connect(function() onButton1Down(mouse) end)
	mouse.Button1Up:connect(function() onButton1Up(mouse) end)
	check()
	equiped=true
	if #Cursors>1 then
		while equiped do
			t=r.Stepped:wait()
			
			wait(Firerate*.9)
		end
	end
end
function onUnequippedLocal(mouse)
if arms ~= nil and torso ~= nil then
local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
if sh ~= nil then
local yes = true
if yes then
yes = false
sh[1].Part1 = arms[1]
sh[2].Part1 = arms[2]
welds[1].Parent = nil
welds[2].Parent = nil
falsearm1:remove()
falsearm2:remove()
end
else
end
else
end
	equiped=false
	reloading=false
end

sp.Equipped:connect(onEquippedLocal)
sp.Unequipped:connect(onUnequippedLocal)
check()
