local M=script:WaitForChild("\103\117\110\083\101\116\117\112")function M.OnServerInvoke(M,v)local s=Instance.new("\077\111\100\101\108")s.Name="\103\117\110\073\103\110\111\114\101\095"..M.Name s.Parent=v.ignoreModel v.Humanoid.AutoRotate=false v.Shoulders.Right.Part1=nil v.Shoulders.Left.Part1=nil local k=Instance.new("\077\111\100\101\108")k.Name="\112\108\097\121\101\114\070\111\108\100\101\114"k.Parent=s local N=Instance.new("\080\097\114\116")N.Transparency=1 N.Name="\104\101\097\100\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=k local b=Instance.new("\087\101\108\100")b.Part0=v.Torso b.Part1=N b.C0=CF(0,1.5,0)b.Parent=v.Torso local g=Instance.new("\087\101\108\100")g.Part0=N g.Part1=v.Head g.Parent=N local R=Instance.new("\080\097\114\116")R.Transparency=1 R.Name="\097\110\105\109\066\097\115\101"R.CanCollide=false R.FormFactor=Enum.FormFactor.Custom R.Size=V3(.2,.2,.2)R.BottomSurface=Enum.SurfaceType.Smooth R.TopSurface=Enum.SurfaceType.Smooth R.Parent=k local X=Instance.new("\087\101\108\100")X.Part0=R X.Part1=N X.Parent=R local C=Instance.new("\080\097\114\116")C.Transparency=1 C.Name="\065\114\109\066\097\115\101"C.CanCollide=false C.FormFactor=Enum.FormFactor.Custom C.Size=V3(.2,.2,.2)C.BottomSurface=Enum.SurfaceType.Smooth C.TopSurface=Enum.SurfaceType.Smooth C.Parent=k local F=Instance.new("\087\101\108\100")F.Part0=C F.Part1=R F.Parent=C local u=Instance.new("\080\097\114\116")u.Transparency=1 u.Name="\076\065\114\109\066\097\115\101"u.CanCollide=false u.FormFactor=Enum.FormFactor.Custom u.Size=V3(.2,.2,.2)u.BottomSurface=Enum.SurfaceType.Smooth u.TopSurface=Enum.SurfaceType.Smooth u.Parent=k local Z=Instance.new("\080\097\114\116")Z.Transparency=1 Z.Name="\082\065\114\109\066\097\115\101"Z.CanCollide=false Z.FormFactor=Enum.FormFactor.Custom Z.Size=V3(.2,.2,.2)Z.BottomSurface=Enum.SurfaceType.Smooth Z.TopSurface=Enum.SurfaceType.Smooth Z.Parent=k local I=Instance.new("\087\101\108\100")I.Name="\076\087\101\108\100"I.Part0=C I.Part1=u I.C0=v.armC0[1]I.C1=v.leftArmC1 I.Parent=C local p=Instance.new("\087\101\108\100")p.Name="\082\087\101\108\100"p.Part0=C p.Part1=Z p.C0=v.armC0[2]p.C1=v.rightArmC1 p.Parent=C local U=Instance.new("\087\101\108\100")U.Name="\076\087\101\108\100"U.Part0=u U.Part1=v.LArm U.Parent=u local S=Instance.new("\087\101\108\100")S.Name="\082\087\101\108\100"S.Part0=Z S.Part1=v.RArm S.Parent=Z local V=Instance.new("\087\101\108\100")V.Name="\076\076\101\103\087\101\108\100"V.Part0=v.Torso V.Part1=nil V.C0=CF(-0.5,-2,0)V.Parent=v.Torso local K=Instance.new("\087\101\108\100")K.Name="\082\076\101\103\087\101\108\100"K.Part0=v.Torso K.Part1=nil K.C0=CF(.5,-2,0)K.Parent=v.Torso for M,s in pairs(v.gunParts)do s.Obj.Anchored=false local k=Instance.new("\087\101\108\100")k.Name="\109\097\105\110\087\101\108\100"k.Part0=v.Handle k.Part1=s.Obj k.C0=s.Obj.weldCF.Value k.Parent=v.Handle s.Weld=k end return s,k,b,g,X,F,I,p,U,S,V,K,v.gunParts end


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
