local d=script:WaitForChild("\103\117\110\083\101\116\117\112")function d.OnServerInvoke(d,R)local v=Instance.new("\077\111\100\101\108")v.Name="\103\117\110\073\103\110\111\114\101\095"..d.Name v.Parent=R.ignoreModel R.Humanoid.AutoRotate=false R.Shoulders.Right.Part1=nil R.Shoulders.Left.Part1=nil local b=Instance.new("\077\111\100\101\108")b.Name="\112\108\097\121\101\114\070\111\108\100\101\114"b.Parent=v local x=Instance.new("\080\097\114\116")x.Transparency=1 x.Name="\104\101\097\100\066\097\115\101"x.CanCollide=false x.FormFactor=Enum.FormFactor.Custom x.Size=V3(.2,.2,.2)x.BottomSurface=Enum.SurfaceType.Smooth x.TopSurface=Enum.SurfaceType.Smooth x.Parent=b local i=Instance.new("\087\101\108\100")i.Part0=R.Torso i.Part1=x i.C0=CF(0,1.5,0)i.Parent=R.Torso local L=Instance.new("\087\101\108\100")L.Part0=x L.Part1=R.Head L.Parent=x local f=Instance.new("\080\097\114\116")f.Transparency=1 f.Name="\097\110\105\109\066\097\115\101"f.CanCollide=false f.FormFactor=Enum.FormFactor.Custom f.Size=V3(.2,.2,.2)f.BottomSurface=Enum.SurfaceType.Smooth f.TopSurface=Enum.SurfaceType.Smooth f.Parent=b local N=Instance.new("\087\101\108\100")N.Part0=f N.Part1=x N.Parent=f local D=Instance.new("\080\097\114\116")D.Transparency=1 D.Name="\065\114\109\066\097\115\101"D.CanCollide=false D.FormFactor=Enum.FormFactor.Custom D.Size=V3(.2,.2,.2)D.BottomSurface=Enum.SurfaceType.Smooth D.TopSurface=Enum.SurfaceType.Smooth D.Parent=b local w=Instance.new("\087\101\108\100")w.Part0=D w.Part1=f w.Parent=D local t=Instance.new("\080\097\114\116")t.Transparency=1 t.Name="\076\065\114\109\066\097\115\101"t.CanCollide=false t.FormFactor=Enum.FormFactor.Custom t.Size=V3(.2,.2,.2)t.BottomSurface=Enum.SurfaceType.Smooth t.TopSurface=Enum.SurfaceType.Smooth t.Parent=b local n=Instance.new("\080\097\114\116")n.Transparency=1 n.Name="\082\065\114\109\066\097\115\101"n.CanCollide=false n.FormFactor=Enum.FormFactor.Custom n.Size=V3(.2,.2,.2)n.BottomSurface=Enum.SurfaceType.Smooth n.TopSurface=Enum.SurfaceType.Smooth n.Parent=b local r=Instance.new("\087\101\108\100")r.Name="\076\087\101\108\100"r.Part0=D r.Part1=t r.C0=R.armC0[1]r.C1=R.leftArmC1 r.Parent=D local A=Instance.new("\087\101\108\100")A.Name="\082\087\101\108\100"A.Part0=D A.Part1=n A.C0=R.armC0[2]A.C1=R.rightArmC1 A.Parent=D local T=Instance.new("\087\101\108\100")T.Name="\076\087\101\108\100"T.Part0=t T.Part1=R.LArm T.Parent=t local I=Instance.new("\087\101\108\100")I.Name="\082\087\101\108\100"I.Part0=n I.Part1=R.RArm I.Parent=n local m=Instance.new("\087\101\108\100")m.Name="\076\076\101\103\087\101\108\100"m.Part0=R.Torso m.Part1=nil m.C0=CF(-0.5,-2,0)m.Parent=R.Torso local O=Instance.new("\087\101\108\100")O.Name="\082\076\101\103\087\101\108\100"O.Part0=R.Torso O.Part1=nil O.C0=CF(.5,-2,0)O.Parent=R.Torso for d,v in pairs(R.gunParts)do v.Obj.Anchored=false local b=Instance.new("\087\101\108\100")b.Name="\109\097\105\110\087\101\108\100"b.Part0=R.Handle b.Part1=v.Obj b.C0=v.Obj.weldCF.Value b.Parent=R.Handle v.Weld=b end return v,b,i,L,N,w,r,A,T,I,m,O,R.gunParts end
----------------------------------------------------------------------
--------------------[ GUNSETUP HANDLING ]-----------------------------
----------------------------------------------------------------------

local gunSetup = script:WaitForChild("gunSetup")
function gunSetup.OnServerInvoke(Player, Vars)
	--------------------[ CREATING IGNORE MODELS ]--------------------------------

	local gunIgnore = Instance.new("Model")
	gunIgnore.Name = "gunIgnore_" .. Player.Name
	gunIgnore.Parent = Vars.ignoreModel

	--------------------[ MODIFYING THE PLAYER ]----------------------------------

	Vars.Humanoid.AutoRotate = false

	Vars.Shoulders.Right.Part1 = nil
	Vars.Shoulders.Left.Part1 = nil

	local playerFolder = Instance.new("Model")
	playerFolder.Name = "playerFolder"
	playerFolder.Parent = gunIgnore

	local headBase = Instance.new("Part")
	headBase.Transparency = 1
	headBase.Name = "headBase"
	headBase.CanCollide = false
	headBase.FormFactor = Enum.FormFactor.Custom
	headBase.Size = V3(0.2, 0.2, 0.2)
	headBase.BottomSurface = Enum.SurfaceType.Smooth
	headBase.TopSurface = Enum.SurfaceType.Smooth
	headBase.Parent = playerFolder

	local headWeld = Instance.new("Weld")
	headWeld.Part0 = Vars.Torso
	headWeld.Part1 = headBase
	headWeld.C0 = CF(0, 1.5, 0)
	headWeld.Parent = Vars.Torso

	local headWeld2 = Instance.new("Weld")
	headWeld2.Part0 = headBase
	headWeld2.Part1 = Vars.Head
	headWeld2.Parent = headBase

	local animBase = Instance.new("Part")
	animBase.Transparency = 1
	animBase.Name = "animBase"
	animBase.CanCollide = false
	animBase.FormFactor = Enum.FormFactor.Custom
	animBase.Size = V3(0.2, 0.2, 0.2)
	animBase.BottomSurface = Enum.SurfaceType.Smooth
	animBase.TopSurface = Enum.SurfaceType.Smooth
	animBase.Parent = playerFolder

	local animWeld = Instance.new("Weld")
	animWeld.Part0 = animBase
	animWeld.Part1 = headBase
	animWeld.Parent = animBase

	local armBase = Instance.new("Part")
	armBase.Transparency = 1
	armBase.Name = "ArmBase"
	armBase.CanCollide = false
	armBase.FormFactor = Enum.FormFactor.Custom
	armBase.Size = V3(0.2, 0.2, 0.2)
	armBase.BottomSurface = Enum.SurfaceType.Smooth
	armBase.TopSurface = Enum.SurfaceType.Smooth
	armBase.Parent = playerFolder

	local ABWeld = Instance.new("Weld")
	ABWeld.Part0 = armBase
	ABWeld.Part1 = animBase
	ABWeld.Parent = armBase

	local LArmBase = Instance.new("Part")
	LArmBase.Transparency = 1
	LArmBase.Name = "LArmBase"
	LArmBase.CanCollide = false
	LArmBase.FormFactor = Enum.FormFactor.Custom
	LArmBase.Size = V3(0.2, 0.2, 0.2)
	LArmBase.BottomSurface = Enum.SurfaceType.Smooth
	LArmBase.TopSurface = Enum.SurfaceType.Smooth
	LArmBase.Parent = playerFolder

	local RArmBase = Instance.new("Part")
	RArmBase.Transparency = 1
	RArmBase.Name = "RArmBase"
	RArmBase.CanCollide = false
	RArmBase.FormFactor = Enum.FormFactor.Custom
	RArmBase.Size = V3(0.2, 0.2, 0.2)
	RArmBase.BottomSurface = Enum.SurfaceType.Smooth
	RArmBase.TopSurface = Enum.SurfaceType.Smooth
	RArmBase.Parent = playerFolder

	local LWeld = Instance.new("Weld")
	LWeld.Name = "LWeld"
	LWeld.Part0 = armBase
	LWeld.Part1 = LArmBase
	LWeld.C0 = Vars.armC0[1]
	LWeld.C1 = Vars.leftArmC1
	LWeld.Parent = armBase

	local RWeld = Instance.new("Weld")
	RWeld.Name = "RWeld"
	RWeld.Part0 = armBase
	RWeld.Part1 = RArmBase
	RWeld.C0 = Vars.armC0[2]
	RWeld.C1 = Vars.rightArmC1
	RWeld.Parent = armBase

	local LWeld2 = Instance.new("Weld")
	LWeld2.Name = "LWeld"
	LWeld2.Part0 = LArmBase
	LWeld2.Part1 = Vars.LArm
	LWeld2.Parent = LArmBase

	local RWeld2 = Instance.new("Weld")
	RWeld2.Name = "RWeld"
	RWeld2.Part0 = RArmBase
	RWeld2.Part1 = Vars.RArm
	RWeld2.Parent = RArmBase

	local LLegWeld = Instance.new("Weld")
	LLegWeld.Name = "LLegWeld"
	LLegWeld.Part0 = Vars.Torso
	LLegWeld.Part1 = nil
	LLegWeld.C0 = CF(-0.5, -2, 0)
	LLegWeld.Parent = Vars.Torso

	local RLegWeld = Instance.new("Weld")
	RLegWeld.Name = "RLegWeld"
	RLegWeld.Part0 = Vars.Torso
	RLegWeld.Part1 = nil
	RLegWeld.C0 = CF(0.5, -2, 0)
	RLegWeld.Parent = Vars.Torso

	for _, Tab in pairs(Vars.gunParts) do
		Tab.Obj.Anchored = false
		local Weld = Instance.new("Weld")
		Weld.Name = "mainWeld"
		Weld.Part0 = Vars.Handle
		Weld.Part1 = Tab.Obj
		Weld.C0 = Tab.Obj.weldCF.Value
		Weld.Parent = Vars.Handle
		Tab.Weld = Weld
	end

	return gunIgnore,
		playerFolder,
		headWeld,
		headWeld2,
		animWeld,
		ABWeld,
		LWeld,
		RWeld,
		LWeld2,
		RWeld2,
		LLegWeld,
		RLegWeld,
		Vars.gunParts
end
