poses={equip={[1]={bw={CFrame.new(-0.299999237,.104995728,.0449981689,1,3.33557523e-06,2.00149793e-06,-3.33557591e-06,1,3.57635798e-07,-2.0014968e-06,-3.57642477e-07,1),easingstyles.Sine,easingdirs.In},hw={CFrame.new(-0.0665130615,0,-0.0558013916,.764023483,-0.133021921,.631326377,.0301536229,.984807849,.17100969,-0.644483387,-0.111618645,.756427288);easingstyles.Sine;easingdirs.In};gw={CFrame.new(-0.459022522,.0749015808,.17483139,2.98023224e-08,.999999404,5.58793545e-08,.939692438,-2.68220901e-07,-0.342020184,-0.342019945,0,-0.939691842),easingstyles.Sine;easingdirs.InOut},tw={CFrame.new(0,0,0,.642787516,0,-0.766044497,0,1,0,.766044497,0,.642787516);easingstyles.Sine,easingdirs.In},raw={CFrame.new(.832485199,-0.995883942,-0.72026825,.986079514,-0.00105690956,.166270182,.166003779,-0.0506849214,-0.984821558,.00946819782,.998714149,-0.0498039126);easingstyles.Sine,easingdirs.InOut};law={CFrame.new(.0268783569,-1.61439657,-2.11585999,-0.222152725,-0.453005493,.863385201,.810823023,-0.57762152,-0.0944410712,.541492224,.67907244,.495627582);easingstyles.Sine;easingdirs.InOut}},[2]={bw={CFrame.new(.0999984741,.104999542,.0449981689,.99999404,-1.41561031e-06,-1.00024045e-06,-1.41561031e-06,.999997914,-2.98023224e-08,-1.00024045e-06,-2.98023224e-08,.999999702);easingstyles.Linear;easingdirs.InOut};hw={CFrame.new(-0.0665130615,0,-0.0558013916,.764023662,-0.133021936,.631326437,.0301536229,.984807849,.17100969,-0.644483507,-0.111618653,.756427407),easingstyles.Linear;easingdirs.InOut},gw={CFrame.new(-0.459018707,-0.325099945,.174833298,2.98023224e-08,.999998987,1.04308128e-07,.939692378,-3.87430191e-07,-0.342020214,-0.342019826,1.49011612e-08,-0.939691484),easingstyles.Linear,easingdirs.InOut},raw={CFrame.new(.810245514,-1.00666809,-0.31388092,.978280365,2.5331974e-06,.2072853,.206869617,-0.0633132458,-0.976317585,.0131213665,.997993708,-0.0619386435),easingstyles.Sine,easingdirs.InOut};law={CFrame.new(.0326385498,-1.61523056,-2.11762619,-0.256376684,-0.429218709,.866049647,.79393369,-0.604562879,-0.0645961761,.55130744,.671025276,.495767117);easingstyles.Sine,easingdirs.InOut}},[3]={bw={CFrame.new(-0.299999237,.104995728,.0449981689,1,3.33557523e-06,2.00149793e-06,-3.33557591e-06,1,3.57635798e-07,-2.0014968e-06,-3.57642477e-07,1);easingstyles.Back;easingdirs.Out};hw={CFrame.new(0,0,0,.642787635,0,.766044438,0,1,0,-0.766044438,0,.642787635);easingstyles.Sine;easingdirs.Out},gw={CFrame.new(-0.209030151,-1.02510452,-0.225169182,9.54675698e-08,.99999994,8.86497986e-10,.939692557,-1.49011612e-07,-0.342020124,-0.342020124,3.348487e-08,-0.939692557);easingstyles.Sine,easingdirs.Out};raw={CFrame.new(.659713745,-1.45935869,.354370117,.99999994,-2.98023224e-08,3.35276127e-08,3.53902578e-08,-3.21306288e-08,-0.999999881,-2.98023224e-08,1,-3.0035153e-08),easingstyles.Sine;easingdirs.Out};law={CFrame.new(-0.000568389893,-1.6040411,-2.10723114,-0.0793336332,-0.53615725,.840381742,.862421989,-0.459712416,-0.211878672,.499934286,.707954705,.498864472),easingstyles.Sine;easingdirs.Out}}},shoot={[1]={bw={CFrame.new(.0999984741,.104999542,.0449981689,.99999404,-1.41561031e-06,-1.00024045e-06,-1.41561031e-06,.999997914,-2.98023224e-08,-1.00024045e-06,-2.98023224e-08,.999999702),easingstyles.Back;easingdirs.Out},hw={CFrame.new(0,0,0,.642787635,0,.766044438,0,1,0,-0.766044438,0,.642787635),easingstyles.Back,easingdirs.Out},gw={CFrame.new(-0.209030151,-1.02510452,-0.225169182,9.54675698e-08,.99999994,8.86497986e-10,.939692557,-1.49011612e-07,-0.342020124,-0.342020124,3.348487e-08,-0.939692557);easingstyles.Back,easingdirs.Out};raw={CFrame.new(.659713745,-1.45935869,.354370117,.99999994,-2.98023224e-08,3.35276127e-08,3.53902578e-08,-3.21306288e-08,-0.999999881,-2.98023224e-08,1,-3.0035153e-08);easingstyles.Back;easingdirs.Out},law={CFrame.new(-0.000568389893,-1.6040411,-2.10723114,-0.0793336332,-0.53615725,.840381742,.862421989,-0.459712416,-0.211878672,.499934286,.707954705,.498864472);easingstyles.Back;easingdirs.Out}},[2]={bw={CFrame.new(-0.299999237,.104995728,.0449981689,1,3.33557523e-06,2.00149793e-06,-3.33557591e-06,1,3.57635798e-07,-2.0014968e-06,-3.57642477e-07,1),easingstyles.Back,easingdirs.Out},hw={CFrame.new(0,0,0,.642787635,0,.766044438,0,1,0,-0.766044438,0,.642787635),easingstyles.Back,easingdirs.Out};gw={CFrame.new(-0.209030151,-1.02510452,-0.225169182,9.54675698e-08,.99999994,8.86497986e-10,.939692557,-1.49011612e-07,-0.342020124,-0.342020124,3.348487e-08,-0.939692557),easingstyles.Back,easingdirs.Out};raw={CFrame.new(.659713745,-1.45935869,.354370117,.99999994,-2.98023224e-08,3.35276127e-08,3.53902578e-08,-3.21306288e-08,-0.999999881,-2.98023224e-08,1,-3.0035153e-08),easingstyles.Back;easingdirs.Out},law={CFrame.new(-0.000568389893,-1.6040411,-2.10723114,-0.0793336332,-0.53615725,.840381742,.862421989,-0.459712416,-0.211878672,.499934286,.707954705,.498864472),easingstyles.Back,easingdirs.Out}}},reload={[1]={bw={CFrame.new(-0.299999237,.104995728,.0449981689,1,3.33557523e-06,2.00149793e-06,-3.33557591e-06,1,3.57635798e-07,-2.0014968e-06,-3.57642477e-07,1);easingstyles.Sine;easingdirs.InOut};hw={CFrame.new(-0.055809021,0,-0.0665130615,.766044319,-0.11161875,.633022487,-3.7252903e-08,.984807789,.17364797,-0.642787755,-0.133022055,.754406393),easingstyles.Sine;easingdirs.InOut};gw={CFrame.new(-0.0572328568,-0.980491638,-0.278923035,.0310192183,.998318493,.0487680063,.937351048,-0.0121154999,-0.34816578,-0.346991748,.0565129519,-0.936161935),easingstyles.Sine,easingdirs.InOut},raw={CFrame.new(1.26604462,-0.913009644,-0.537094116,.999999821,-3.57627869e-07,6.27093755e-08,4.48221016e-10,-0.173648104,-0.984807611,3.85997794e-07,.984807551,-0.173648149)*CFrame.new(0,0,.5);easingstyles.Sine,easingdirs.InOut},law={(CFrame.new(-1.08869362,-1.33496189,-1.19934082,.766044259,4.22527791e-10,-0.642787695,-0.111618742,.98480767,-0.133021995,.633022428,.17364791,.754406333)*CFrame.new(0,0,.5))*CFrame.new(0,-0.8,0);easingstyles.Sine,easingdirs.InOut}},[2]={bw={CFrame.new(-0.299999237,.104995728,.0449981689,1,3.33557523e-06,2.00149793e-06,-3.33557591e-06,1,3.57635798e-07,-2.0014968e-06,-3.57642477e-07,1);easingstyles.Sine,easingdirs.In},hw={CFrame.new(-0.055809021,0,-0.0665130615,.864329457,-0.11161875,.490383387,.03015358,.984807789,.171009868,-0.502021194,-0.133022055,.854564071),easingstyles.Sine,easingdirs.In};gw={CFrame.new(-0.0572328568,-0.980491638,-0.278923035,.0310192183,.998318493,.0487680063,.937351048,-0.0121154999,-0.34816578,-0.346991748,.0565129519,-0.936161935);easingstyles.Sine,easingdirs.In},raw={((CFrame.new(1.11267471,-0.963647842,-0.780944824,.96286577,.230811596,-0.140053496,-0.10095071,-0.173324212,-0.979677141,-0.250395477,.957436204,-0.143587425)*CFrame.new(.2,0,0))*CFrame.new(0,0,.5))*CFrame.Angles(0,-0.05,0);easingstyles.Sine,easingdirs.In};law={(CFrame.new(-0.289166451,-0.800122261,-1.59056854,.533511698,-0.820919991,-0.203605846,-0.0797704309,.190816656,-0.978378952,.842022419,.53821826,.0363177806)*CFrame.new(0,0,.5))*CFrame.new(0,0,0),easingstyles.Sine;easingdirs.In}},[3]={bw={CFrame.new(-0.299999237,.104995728,.0449981689,1,3.33557523e-06,2.00149793e-06,-3.33557591e-06,1,3.57635798e-07,-2.0014968e-06,-3.57642477e-07,1),easingstyles.Sine,easingdirs.Out},hw={CFrame.new(-0.055809021,0,-0.0665130615,.936352491,-0.11161875,.332844049,.0593910292,.984807789,.163175717,-0.34600088,-0.133022055,.928756297);easingstyles.Sine,easingdirs.Out};gw={CFrame.new(-0.0572328568,-0.980491638,-0.278923035,.0310192183,.998318493,.0487680063,.937351048,-0.0121154999,-0.34816578,-0.346991748,.0565129519,-0.936161935);easingstyles.Sine,easingdirs.Out},raw={((CFrame.new(.951341629,-1.00614738,-0.96661377,.887119889,.393562078,-0.241094485,-0.185951054,-0.173324212,-0.967150807,-0.422421396,.902810454,-0.0805761442)*CFrame.new(.3,0,0))*CFrame.new(0,0,.5))*CFrame.Angles(0,-0.1,0),easingstyles.Sine;easingdirs.Out};law={(CFrame.new(-0.798740387,-0.729963303,-1.94239807,.788041711,-0.601489127,-0.131151706,-0.0967602059,.0893746093,-0.991286814,.60796994,.793865442,.0122306943)*CFrame.new(0,0,.5))*CFrame.new(.5,0,-0.4),easingstyles.Sine;easingdirs.Out}},[4]={bw={CFrame.new(-0.299999237,.104995728,.0449981689,1,3.33557523e-06,2.00149793e-06,-3.33557591e-06,1,3.57635798e-07,-2.0014968e-06,-3.57642477e-07,1);easingstyles.Sine,easingdirs.In},hw={CFrame.new(-0.055809021,0,-0.0665130615,.936352491,-0.11161875,.332844049,.0593910292,.984807789,.163175717,-0.34600088,-0.133022055,.928756297),easingstyles.Sine,easingdirs.In},gw={CFrame.new(-0.0572328568,-0.980491638,-0.278923035,.0310192183,.998318493,.0487680063,.937351048,-0.0121154999,-0.34816578,-0.346991748,.0565129519,-0.936161935),easingstyles.Sine;easingdirs.In};raw={((CFrame.new(.951341629,-1.00614738,-0.96661377,.887119889,.393562078,-0.241094485,-0.185951054,-0.173324212,-0.967150807,-0.422421396,.902810454,-0.0805761442)*CFrame.Angles(0,-0.45,0))*CFrame.new(0,0,.5))*CFrame.Angles(0,-0.15,0),easingstyles.Sine,easingdirs.In},law={((CFrame.new(-0.733897209,-0.698638916,-1.94715118,.733374,-0.676505506,-0.0670995787,-0.0810378194,.0110032074,-0.996650279,.67497766,.736355007,-0.0467530787)*CFrame.new(0,0,.5))*CFrame.Angles(.15,0,0))*CFrame.new(-0.1,0,0),easingstyles.Sine;easingdirs.In}},[5]={bw={CFrame.new(-0.299999237,.104995728,.0449981689,1,3.33557523e-06,2.00149793e-06,-3.33557591e-06,1,3.57635798e-07,-2.0014968e-06,-3.57642477e-07,1);easingstyles.Sine;easingdirs.Out},hw={CFrame.new(-0.055809021,0,-0.0665130615,.936352491,-0.11161875,.332844049,.0593910292,.984807789,.163175717,-0.34600088,-0.133022055,.928756297),easingstyles.Sine,easingdirs.Out},gw={CFrame.new(-0.0572328568,-0.980491638,-0.278923035,.0310192183,.998318493,.0487680063,.937351048,-0.0121154999,-0.34816578,-0.346991748,.0565129519,-0.936161935);easingstyles.Sine,easingdirs.Out},raw={((CFrame.new(.956790924,-0.985137939,-0.964424133,.887119889,.382671088,-0.258031964,-0.185951054,-0.215345785,-0.95867002,-0.422421396,.898436666,-0.119879492)*CFrame.Angles(0,-0.55,0))*CFrame.new(0,0,.4))*CFrame.Angles(0,-0.1,0),easingstyles.Sine,easingdirs.Out};law={(CFrame.new(-0.702912331,-0.529985428,-1.91860962,.691018224,-0.696123064,-0.194694132,-0.3362284,-0.0711144507,-0.939091682,.639877796,.714391232,-0.28319779)*CFrame.new(0,0,.5))*CFrame.new(.1,0,0);easingstyles.Sine,easingdirs.Out}}};aim={[1]={bw={CFrame.new(-0.299999237,.104995728,.0449981689,1,3.33557523e-06,2.00149793e-06,-3.33557591e-06,1,3.57635798e-07,-2.0014968e-06,-3.57642477e-07,1);easingstyles.Back;easingdirs.Out},hw={CFrame.new(0,0,0,.642787635,0,.766044438,0,1,0,-0.766044438,0,.642787635),easingstyles.Sine,easingdirs.Out},gw={CFrame.new(-0.209030151,-1.02510452,-0.225169182,9.54675698e-08,.99999994,8.86497986e-10,.939692557,-1.49011612e-07,-0.342020124,-0.342020124,3.348487e-08,-0.939692557);easingstyles.Sine,easingdirs.Out},raw={CFrame.new(.659713745,-1.45935869,.354370117,.99999994,-2.98023224e-08,3.35276127e-08,3.53902578e-08,-3.21306288e-08,-0.999999881,-2.98023224e-08,1,-3.0035153e-08),easingstyles.Sine,easingdirs.Out},law={CFrame.new(-0.000568389893,-1.6040411,-2.10723114,-0.0793336332,-0.53615725,.840381742,.862421989,-0.459712416,-0.211878672,.499934286,.707954705,.498864472);easingstyles.Sine;easingdirs.Out}}};reloadmag={[1]={mag={CFrame.new(.383216858,.00605773926,-0.895876884,.982579589,-0.0196594987,-0.184799746,.0194191728,.999806643,-0.00311047747,.184825167,-0.000532366452,.982771337),easingstyles.Sine,easingdirs.In}};[2]={mag={CFrame.new(-0.341659546,-0.00597381592,-0.82459569,.943051159,-0.0805884004,.32273832,.108094886,.99179846,-0.0682025552,-0.314594954,.0992048606,.944027781)*CFrame.new(-0.2,.1,0);easingstyles.Sine,easingdirs.Out}},[3]={mag={(CFrame.new(-0.343078613,.033826828,-0.555139065,.931312561,-0.056615673,.359807789,.0651112646,.997804642,-0.0115158707,-0.358372539,.0341522247,.932950974)*CFrame.Angles(0,.3,0))*CFrame.new(-0.3,.2,0);easingstyles.Sine,easingdirs.In}};[4]={mag={CFrame.new(-0.226425171,.0250015259,-0.604773998,.984800279,1.56462193e-06,.173645124,1.68196857e-06,.999979436,-5.66244125e-07,-0.173649177,-8.04662704e-07,.984803438),easingstyles.Sine;easingdirs.Out}}}}function clonemag(o,m)local T=magcmodel:Clone()local g=T:WaitForChild("\109\097\103\112\097\114\116")T.Name=m T.Parent=o return T,g end function tween(o,m,T,g,z,H,Q,W)local y=TweenInfo.new(o,m,T,g,z,H)local C=W local d=tweenservice:Create(Q,y,C)d:Play()end function linearlerp(o,m,T)return o+(m-o)*T end function clientdropshell()local o=Instance.new("\083\112\097\119\110\076\111\099\097\116\105\111\110",gunmodel)o.Enabled=false o.Name="\115\104\101\108\108\059"o.Shape="\067\121\108\105\110\100\101\114"o.Size=Vector3.new(.25,.1,.1)o.BrickColor=BrickColor.new("\078\101\119 \089\101\108\108\101\114")o.Material="\071\108\097\115\115"o.Anchored=true o.CanCollide=false o.CFrame=boltcweld.Part1.CFrame*CFrame.new(.1,0,0)o:BreakJoints()local m local T=0 local g=false local z=math.random(1,10)/5 local H=math.random(8,15)local Q=boltcweld.Part1.CFrame.upVector local W=boltcweld.Part1.CFrame.rightVector m=runservice.Stepped:Connect(function(g,y)T=T+y o.CFrame=CFrame.new(o.Position,o.Position+Q)*CFrame.new(0,z*y,-H*y)o.CFrame=CFrame.new(o.Position,o.Position+W)*CFrame.Angles(0,math.pi/2,0)z=z-y*shellfallspeed if T>shellflytime then o:Destroy()m:Disconnect()end end)end function pemit(o,m,T,g,z,H,Q,W,y)pcall(function()local C=Instance.new("\080\097\114\116\105\099\108\101\069\109\105\116\116\101\114",o)C.Color=ColorSequence.new(m)C.Texture="\114\098\120\097\115\115\101\116\105\100\058\047\047\051\055\053\056\052\055\057\053\055"C.Name="\103\101\109\105\116"C.Drag=10 C.EmissionDirection=W C.Speed=NumberRange.new(Q)C.Rate=500 C.Lifetime=NumberRange.new(z,H)C.SpreadAngle=Vector2.new(-20,20)C.Transparency=NumberSequence.new(.75,1)C.Size=NumberSequence.new(T,g)task.spawn(function()task.wait(y)C.Enabled=false debris:AddItem(C,.5)end)end)end function muzzleflash(o,m)local T=Instance.new("\083\112\097\119\110\076\111\099\097\116\105\111\110",gunmodel)T.Enabled=false;(Instance.new("\083\112\101\099\105\097\108\077\101\115\104",T)).MeshType=Enum.MeshType.Sphere local g=Instance.new("\080\111\105\110\116\076\105\103\104\116",T)g.Brightness=1-m T.Size=o T.Transparency=m T.CanCollide=false T.Anchored=true T.Material=Enum.Material.Neon T.CFrame=gunclufa.CFrame*CFrame.new(-o.x/2-.3,0,0)pemit(gunclufa,Color3.fromRGB(255,255,255),.15,.35,.1,.2,10,"\076\101\102\116",.1)debris:AddItem(T,.025)end function cpose(o,m,T,g)if equiptick==g then if currentlyfps then if o=="\115\104\111\111\116"and m==1 then clientdropshell()muzzleflash(Vector3.new(2,.6,.6),math.random(1,15)/10)if adsing then offset=(offset*CFrame.new(0,0,.05))*CFrame.Angles(0,0,.015)else offset=(offset*CFrame.new(0,0,.1))*CFrame.Angles(0,0,.03)end elseif o=="\101\113\117\105\112"and m==2 then recoiltick=tick()recoilup(0,-0.35,1,.3,recoiltick)if bchambered.Value>0 then clientdropshell()end elseif o=="\114\101\108\111\097\100"then if m==1 then recoilup(-0.7,.3,-1,.4,recoiltick)end end end tween(T,poses[o][m].raw[2],poses[o][m].raw[3],0,false,0,rarmcweld,{C0=poses[o][m].raw[1]})tween(T,poses[o][m].law[2],poses[o][m].law[3],0,false,0,larmcweld,{C0=poses[o][m].law[1]})tween(T,poses[o][m].gw[2],poses[o][m].gw[3],0,false,0,guncweld,{C0=poses[o][m].gw[1]})tween(T,poses[o][m].bw[2],poses[o][m].bw[3],0,false,0,boltcweld,{C0=poses[o][m].bw[1]})end end function ciposeconvert(o,m,T,g,z)if equiptick==z then if o=="\114\101\108\111\097\100\109\097\103"then if m==1 then reloadmagcmodel,reloadmagcpart=clonemag(guncmodel,"\109\097\103")reloadmagcweld=Instance.new("\087\101\108\100",reloadmagcmodel)reloadmagcweld.Name="\104\097\110\100\109\097\103\119\101\108\100"reloadmagcweld.Part0=maincpart reloadmagcweld.Part1=reloadmagcpart reloadmagcweld.C0=CFrame.new(.771263123,-2.07442856,-2.45114708,.108410954,.822345078,-0.558561325,-0.0455624163,.565389991,.823553741,.993062019,-0.0638353601,.0987635553)if not currentlyfps then modeltransparency(reloadmagcmodel,1)end elseif m==3 then local o,m=clonemag(guncmodel,"\116\104\114\111\119")local T=Instance.new("\066\111\100\121\086\101\108\111\099\105\116\121",m)T.MaxForce=Vector3.new(1/0,1/0,1/0)T.Velocity=(mainpart.CFrame.lookVector*-math.random(5,10)+mainpart.CFrame.rightVector*-math.random(10,20))+mainpart.CFrame.upVector*-math.random(10,20)local g=Instance.new("\066\111\100\121\065\110\103\117\108\097\114\086\101\108\111\099\105\116\121",m)g.MaxTorque=Vector3.new(1/0,1/0,1/0)g.AngularVelocity=hrp.CFrame.rightVector*math.random(15,20)debris:AddItem(T,.1)debris:AddItem(m,.5)if not currentlyfps then modeltransparency(o,1)end modeltransparency(magcmodel,1)elseif m==4 then task.spawn(function()task.wait(.2)reloadmagcmodel:Destroy()if currentlyfps then modeltransparency(magcmodel,0)end end)end end tween(g,poses[o][m][T][2],poses[o][m][T][3],0,false,0,reloadmagcweld,{C0=poses[o][m][T][1]})end end function movec(o)cam.CFrame=cam.CFrame*o end function recoilup(o,m,T,g,z)local H=tick()task.spawn(function()while runservice.RenderStepped:wait()and(tick()<H+g and recoiltick==z)do movec(recoilcf:Inverse())recoilcf=recoilcf*CFrame.Angles(((o*delta)*(recmult/recdampmult))*((g+H)-tick()),((m*delta)*(recmult/recdampmult))*((g+H)-tick()),((T*delta)*(recmult/recdampmult))*((g+H)-tick()))movec(recoilcf)end end)end remote.OnClientEvent:Connect(function(o,m,T,g,z)if state~="\117\110\101\113\117\105\112\112\101\100"then if o=="\114\101\099\111\105\108"then recoiltick=tick()recoilup(recxamount,(math.random(-10,10)/10)*recyamount,(math.random(-10,10)/10)*reczamount,rectime,recoiltick)elseif o=="\102\114\111\109\115\101\114\118\101\114\112\111\115\101"then cpose(m,T,g,equiptick)elseif o=="\102\114\111\109\115\101\114\118\101\114\105\110\100\105\118\105\100\117\097\108\112\111\115\101"then ciposeconvert(m,T,g,z,equiptick)end end end)function ads(o)if o and(not adsing and(hrp.Velocity.Magnitude<17 and(head.CFrame.p-cam.CFrame.p).Magnitude<1.7))then adsing=true recmult=recmult/2 remote:FireServer("\053",true)elseif not o and adsing then adsing=false recmult=recmult*2 remote:FireServer("\053",false)end end function makefpsviewmodel()viewmodel=Instance.new("\077\111\100\101\108",cam)viewmodel.Name="\103\117\110\118\105\101\119\109\111\100\101\108"Instance.new("\072\117\109\097\110\111\105\100",viewmodel)local o=Instance.new("\080\097\114\116",viewmodel)o.Anchored=true o.CanCollide=false o.Transparency=1 o.Size=Vector3.new()local m=Instance.new("\080\097\114\116",viewmodel)m.Size=Vector3.new(.7,2,.7)m.Color=character["\082\105\103\104\116 \065\114\109"].Color m.CanCollide=false m.Name="\082\105\103\104\116 \065\114\109"local T=Instance.new("\080\097\114\116",viewmodel)T.Size=Vector3.new(.7,2,.7)T.Color=character["\076\101\102\116 \065\114\109"].Color T.CanCollide=false T.Name="\076\101\102\116 \065\114\109"local g=gunmodel:Clone()local z=g:WaitForChild("\072\097\110\100\108\101")local H=g:WaitForChild("\109\097\105\110\112\097\114\116")gunclufa=g:WaitForChild("\108\117\102\097")maincpart=H guncmodel=g boltcweld=H:WaitForChild("\098\111\108\116\119\101\108\100")magcmodel=g:WaitForChild("\109\097\103")g.Parent=viewmodel for o,m in pairs(g:GetDescendants())do if m:IsA("\066\097\115\101\080\097\114\116")then m.CanCollide=false m.Anchored=false end end larmcweld=Instance.new("\087\101\108\100",o)larmcweld.Part0=o larmcweld.Part1=T larmcweld.C0=CFrame.new(1,-2.5,0)rarmcweld=Instance.new("\087\101\108\100",o)rarmcweld.Part0=o rarmcweld.Part1=m rarmcweld.C0=CFrame.new(1,-2.5,0)guncweld=Instance.new("\087\101\108\100",o)guncweld.Part0=m guncweld.Part1=z guncweld.C0=CFrame.new(1,-2.5,0)pcall(function()(character.Shirt:Clone()).Parent=viewmodel end)gunmodel.DescendantAdded:Connect(function(o)if(cam.CFrame.p-head.Position).magnitude<1.3 then if o.Name=="\116\104\114\111\119\115\101\114\118\101\114"or o.Name=="\114\101\108\111\097\100\115\101\114\118\101\114"then o:WaitForChild("\080\097\114\116")modeltransparency(o,1)elseif o:IsA("\080\097\114\116\105\099\108\101\069\109\105\116\116\101\114")and o.Name=="\103\101\109\105\116"then o.Transparency=NumberSequence.new(1)elseif o:IsA("\066\097\115\101\080\097\114\116")and o.Name=="\109\117\122\122\108\101\102\108\097\115\104"or o.Name=="\115\104\101\108\108\059"then o.Transparency=1 elseif o:IsA("\080\111\105\110\116\076\105\103\104\116")and o.Name=="\109\102\108\097\115\104"then o.Brightness=0 end end end)modeltransparency(viewmodel,1)return o end tool.Equipped:Connect(function()state="\101\113\117\105\112\112\101\100"equiptick=tick()local o=equiptick local m=0 local T=cam.CFrame savedfov=cam.FieldOfView offset=CFrame.new()character=owner.Character gui.Parent=ownergui local g=makefpsviewmodel()mouse.TargetFilter=g.Parent chamberedgui.Text=tostring(bchambered.Value)ammogui.Text=tostring(binmag.Value)maggui.Text=tostring(magleft.Value)humanoid=character:FindFirstChildOfClass("\072\117\109\097\110\111\105\100")head=character.Head hrp=character.HumanoidRootPart humanoid.AutoRotate=false rstepgun=runservice.RenderStepped:Connect(function()if state~="\117\110\101\113\117\105\112\112\101\100"and(humanoid.Health>0 and equiptick==o)then delta=tick()-frametick movec(recoilcf:Inverse())hrp.CFrame=hrp.CFrame:lerp(CFrame.new(hrp.Position,Vector3.new(mouse.Hit.p.x,hrp.Position.y,mouse.Hit.p.z)),delta*15)recoilcf=recoilcf:lerp(CFrame.new(),delta*currentcspeed)movec(recoilcf)humanoid.CameraOffset=Vector3.new()if(cam.CFrame.p-head.Position).magnitude<1.3 and not currentlyfps then humanoid.CameraOffset=Vector3.new(0,.4,0)guntransparency(1)modeltransparency(viewmodel,0)currentlyfps=true elseif(cam.CFrame.p-head.Position).magnitude>1.3 and currentlyfps then guntransparency(0)modeltransparency(viewmodel,1)if adsing then ads(false)end currentlyfps=false end local o=cam.CFrame:ToObjectSpace(T)local z,H,Q=o:ToOrientation()local W=hrp.CFrame:vectorToObjectSpace(hrp.Velocity)local y,C,d=math.clamp(W.x,-35,35),math.clamp(W.z,-35,35),math.clamp(W.y,-50,50)local r=Vector3.new(y,0,C)if adsing then offset=offset:lerp(CFrame.Angles(z/2,H/2,-H/2)*CFrame.new(-0.45,.4,.25),delta*5)cam.FieldOfView=linearlerp(cam.FieldOfView,35,delta*4)else offset=offset:lerp(CFrame.Angles(z/2,H/2,-H/2),delta*10)cam.FieldOfView=linearlerp(cam.FieldOfView,70+(Vector3.new(hrp.Velocity.x,0,hrp.Velocity.z)).Magnitude/5,delta*5)end if r.Magnitude>.1 then if r.Magnitude<19 or state=="\115\104\111\111\116\105\110\103"then offset=offset:lerp(CFrame.Angles(z/2,H/2-math.cos(tick()*7)*(r.Magnitude/350),(-H/2+math.sin(tick()*7)*(r.Magnitude/120))-y/60)*CFrame.new(math.sin(tick()*7)*(r.Magnitude/250),-math.cos(tick()*14)*(r.Magnitude/250),0),delta*5)elseif state~="\115\104\111\111\116\105\110\103"and humanoid.FloorMaterial~=Enum.Material.Air then if adsing then ads(false)end offset=offset:lerp((CFrame.Angles(z/2,H/2-math.cos(tick()*10)*(r.Magnitude/250),(-H/2+math.sin(tick()*10)*(r.Magnitude/70))-y/60)*CFrame.new(1+math.sin(tick()*10)*(r.Magnitude/150),-0.4-math.cos(tick()*20)*(r.Magnitude/150),0))*CFrame.Angles(math.rad(-20),math.pi/2,0),delta*10)end end g.CFrame=cam.CFrame*offset T=cam.CFrame m=m+delta if m>.1 then remote:FireServer("\049",(mouse.Hit.p-head.CFrame.p).unit.y)m=0 end else rstepgun:Disconnect()end frametick=tick()end)end)mouse.KeyDown:Connect(function(o)if state=="\101\113\117\105\112\112\101\100"then o=o:lower()if o=="\102"then remote:FireServer("\051")elseif o=="\114"then remote:FireServer("\052")elseif o:byte()==48 then remote:FireServer("\054",true)end end end)mouse.KeyUp:Connect(function(o)if state=="\101\113\117\105\112\112\101\100"then o=o:lower()if o:byte()==48 then remote:FireServer("\054",false)end end end)mouse.Button2Down:Connect(function()if state~="\117\110\101\113\117\105\112\112\101\100"then ads(true)end end)mouse.Button2Up:Connect(function()if state~="\117\110\101\113\117\105\112\112\101\100"then ads(false)end end)tool.Activated:Connect(function()if state=="\101\113\117\105\112\112\101\100"then shoottick=tick()state="\115\104\111\111\116\105\110\103"local o=shoottick while shoottick==o and(state=="\115\104\111\111\116\105\110\103"and humanoid.Health>0)do if binmag.Value>0 or bchambered.Value>0 then remote:FireServer("\050",mouse.Hit.p)task.wait(gunspeed.Value)else break end end if state=="\115\104\111\111\116\105\110\103"then state="\101\113\117\105\112\112\101\100"end end end)tool.Deactivated:Connect(function()if state=="\115\104\111\111\116\105\110\103"then state="\101\113\117\105\112\112\101\100"end end)tool.Unequipped:Connect(function()state="\117\110\101\113\117\105\112\112\101\100"gui.Parent=tool viewmodel:Destroy()guntransparency(0)if adsing then ads(false)end cam.FieldOfView=savedfov currentlyfps=false recoilcf=CFrame.new()humanoid.AutoRotate=true end)

poses = {
	equip = {
		[1] = {
			--mw = {CFrame.new(-0.2264328, 0.0250015259, -0.604776859, 0.98480773, 0, 0.173648193, 0, 1, 0, -0.173648193, 0, 0.98480773), easingstyles.Sine, easingdirs.In},
			bw = {CFrame.new(-0.299999237, 0.104995728, 0.0449981689, 1, 3.33557523e-06, 2.00149793e-06, -3.33557591e-06, 1, 3.57635798e-07, -2.0014968e-06, -3.57642477e-07, 1), easingstyles.Sine, easingdirs.In},
			hw = {CFrame.new(-0.0665130615, 0, -0.0558013916, 0.764023483, -0.133021921, 0.631326377, 0.0301536229, 0.984807849, 0.17100969, -0.644483387, -0.111618645, 0.756427288), easingstyles.Sine, easingdirs.In},
			gw = {CFrame.new(-0.459022522, 0.0749015808, 0.17483139, 2.98023224e-08, 0.999999404, 5.58793545e-08, 0.939692438, -2.68220901e-07, -0.342020184, -0.342019945, 0, -0.939691842), easingstyles.Sine, easingdirs.InOut},
			tw = {CFrame.new(0, 0, 0, 0.642787516, 0, -0.766044497, 0, 1, 0, 0.766044497, 0, 0.642787516), easingstyles.Sine, easingdirs.In},
			raw = {CFrame.new(0.832485199, -0.995883942, -0.72026825, 0.986079514, -0.00105690956, 0.166270182, 0.166003779, -0.0506849214, -0.984821558, 0.00946819782, 0.998714149, -0.0498039126), easingstyles.Sine, easingdirs.InOut},
			law = {CFrame.new(0.0268783569, -1.61439657, -2.11585999, -0.222152725, -0.453005493, 0.863385201, 0.810823023, -0.57762152, -0.0944410712, 0.541492224, 0.67907244, 0.495627582), easingstyles.Sine, easingdirs.InOut},
		},
		[2] = {
			--mw = {CFrame.new(-0.2264328, 0.0250015259, -0.604776859, 0.98480773, 0, 0.173648193, 0, 1, 0, -0.173648193, 0, 0.98480773), easingstyles.Sine, easingdirs.In},
			bw = {CFrame.new(0.0999984741, 0.104999542, 0.0449981689, 0.99999404, -1.41561031e-06, -1.00024045e-06, -1.41561031e-06, 0.999997914, -2.98023224e-08, -1.00024045e-06, -2.98023224e-08, 0.999999702), easingstyles.Linear, easingdirs.InOut},
			hw = {CFrame.new(-0.0665130615, 0, -0.0558013916, 0.764023662, -0.133021936, 0.631326437, 0.0301536229, 0.984807849, 0.17100969, -0.644483507, -0.111618653, 0.756427407), easingstyles.Linear, easingdirs.InOut},
			gw = {CFrame.new(-0.459018707, -0.325099945, 0.174833298, 2.98023224e-08, 0.999998987, 1.04308128e-07, 0.939692378, -3.87430191e-07, -0.342020214, -0.342019826, 1.49011612e-08, -0.939691484), easingstyles.Linear, easingdirs.InOut},
			raw = {CFrame.new(0.810245514, -1.00666809, -0.31388092, 0.978280365, 2.5331974e-06, 0.2072853, 0.206869617, -0.0633132458, -0.976317585, 0.0131213665, 0.997993708, -0.0619386435), easingstyles.Sine, easingdirs.InOut},
			law = {CFrame.new(0.0326385498, -1.61523056, -2.11762619, -0.256376684, -0.429218709, 0.866049647, 0.79393369, -0.604562879, -0.0645961761, 0.55130744, 0.671025276, 0.495767117), easingstyles.Sine, easingdirs.InOut},
		},
		[3] = {
			--mw = {CFrame.new(-0.2264328, 0.0250015259, -0.604776859, 0.98480773, 0, 0.173648193, 0, 1, 0, -0.173648193, 0, 0.98480773), easingstyles.Sine, easingdirs.In},
			bw = {CFrame.new(-0.299999237, 0.104995728, 0.0449981689, 1, 3.33557523e-06, 2.00149793e-06, -3.33557591e-06, 1, 3.57635798e-07, -2.0014968e-06, -3.57642477e-07, 1), easingstyles.Back, easingdirs.Out},
			hw = {CFrame.new(0, 0, 0, 0.642787635, 0, 0.766044438, 0, 1, 0, -0.766044438, 0, 0.642787635), easingstyles.Sine, easingdirs.Out},
			gw = {CFrame.new(-0.209030151, -1.02510452, -0.225169182, 9.54675698e-08, 0.99999994, 8.86497986e-10, 0.939692557, -1.49011612e-07, -0.342020124, -0.342020124, 3.348487e-08, -0.939692557), easingstyles.Sine, easingdirs.Out},
			raw = {CFrame.new(0.659713745, -1.45935869, 0.354370117, 0.99999994, -2.98023224e-08, 3.35276127e-08, 3.53902578e-08, -3.21306288e-08, -0.999999881, -2.98023224e-08, 1, -3.0035153e-08), easingstyles.Sine, easingdirs.Out},
			law = {CFrame.new(-0.000568389893, -1.6040411, -2.10723114, -0.0793336332, -0.53615725, 0.840381742, 0.862421989, -0.459712416, -0.211878672, 0.499934286, 0.707954705, 0.498864472), easingstyles.Sine, easingdirs.Out},
		}
	},
	shoot = {
		[1] = {
			--mw = {CFrame.new(-0.2264328, 0.0250015259, -0.604776859, 0.98480773, 0, 0.173648193, 0, 1, 0, -0.173648193, 0, 0.98480773), easingstyles.Sine, easingdirs.In},
			bw = {CFrame.new(0.0999984741, 0.104999542, 0.0449981689, 0.99999404, -1.41561031e-06, -1.00024045e-06, -1.41561031e-06, 0.999997914, -2.98023224e-08, -1.00024045e-06, -2.98023224e-08, 0.999999702), easingstyles.Back, easingdirs.Out},
			hw = {CFrame.new(0, 0, 0, 0.642787635, 0, 0.766044438, 0, 1, 0, -0.766044438, 0, 0.642787635), easingstyles.Back, easingdirs.Out},
			gw = {CFrame.new(-0.209030151, -1.02510452, -0.225169182, 9.54675698e-08, 0.99999994, 8.86497986e-10, 0.939692557, -1.49011612e-07, -0.342020124, -0.342020124, 3.348487e-08, -0.939692557), easingstyles.Back, easingdirs.Out},
			raw = {CFrame.new(0.659713745, -1.45935869, 0.354370117, 0.99999994, -2.98023224e-08, 3.35276127e-08, 3.53902578e-08, -3.21306288e-08, -0.999999881, -2.98023224e-08, 1, -3.0035153e-08), easingstyles.Back, easingdirs.Out},
			law = {CFrame.new(-0.000568389893, -1.6040411, -2.10723114, -0.0793336332, -0.53615725, 0.840381742, 0.862421989, -0.459712416, -0.211878672, 0.499934286, 0.707954705, 0.498864472), easingstyles.Back, easingdirs.Out},
		},
		[2] = {
			--mw = {CFrame.new(-0.2264328, 0.0250015259, -0.604776859, 0.98480773, 0, 0.173648193, 0, 1, 0, -0.173648193, 0, 0.98480773), easingstyles.Sine, easingdirs.In},
			bw = {CFrame.new(-0.299999237, 0.104995728, 0.0449981689, 1, 3.33557523e-06, 2.00149793e-06, -3.33557591e-06, 1, 3.57635798e-07, -2.0014968e-06, -3.57642477e-07, 1), easingstyles.Back, easingdirs.Out},
			hw = {CFrame.new(0, 0, 0, 0.642787635, 0, 0.766044438, 0, 1, 0, -0.766044438, 0, 0.642787635), easingstyles.Back, easingdirs.Out},
			gw = {CFrame.new(-0.209030151, -1.02510452, -0.225169182, 9.54675698e-08, 0.99999994, 8.86497986e-10, 0.939692557, -1.49011612e-07, -0.342020124, -0.342020124, 3.348487e-08, -0.939692557), easingstyles.Back, easingdirs.Out},
			raw = {CFrame.new(0.659713745, -1.45935869, 0.354370117, 0.99999994, -2.98023224e-08, 3.35276127e-08, 3.53902578e-08, -3.21306288e-08, -0.999999881, -2.98023224e-08, 1, -3.0035153e-08), easingstyles.Back, easingdirs.Out},
			law = {CFrame.new(-0.000568389893, -1.6040411, -2.10723114, -0.0793336332, -0.53615725, 0.840381742, 0.862421989, -0.459712416, -0.211878672, 0.499934286, 0.707954705, 0.498864472), easingstyles.Back, easingdirs.Out},
		}
	},
	reload = {
		[1] = {
			--mw = {CFrame.new(-0.2264328, 0.0250015259, -0.604776859, 0.98480773, 0, 0.173648193, 0, 1, 0, -0.173648193, 0, 0.98480773), easingstyles.Sine, easingdirs.In},
			bw = {CFrame.new(-0.299999237, 0.104995728, 0.0449981689, 1, 3.33557523e-06, 2.00149793e-06, -3.33557591e-06, 1, 3.57635798e-07, -2.0014968e-06, -3.57642477e-07, 1), easingstyles.Sine, easingdirs.InOut},
			hw = {CFrame.new(-0.055809021, 0, -0.0665130615, 0.766044319, -0.11161875, 0.633022487, -3.7252903e-08, 0.984807789, 0.17364797, -0.642787755, -0.133022055, 0.754406393), easingstyles.Sine, easingdirs.InOut},
			gw = {CFrame.new(-0.0572328568, -0.980491638, -0.278923035, 0.0310192183, 0.998318493, 0.0487680063, 0.937351048, -0.0121154999, -0.34816578, -0.346991748, 0.0565129519, -0.936161935), easingstyles.Sine, easingdirs.InOut},
			raw = {CFrame.new(1.26604462, -0.913009644, -0.537094116, 0.999999821, -3.57627869e-07, 6.27093755e-08, 4.48221016e-10, -0.173648104, -0.984807611, 3.85997794e-07, 0.984807551, -0.173648149) * CFrame.new(0,0,0.5), easingstyles.Sine, easingdirs.InOut},
			law = {CFrame.new(-1.08869362, -1.33496189, -1.19934082, 0.766044259, 4.22527791e-10, -0.642787695, -0.111618742, 0.98480767, -0.133021995, 0.633022428, 0.17364791, 0.754406333) * CFrame.new(0,0,0.5) * CFrame.new(0,-0.8,0), easingstyles.Sine, easingdirs.InOut},
		},
		[2] = {
			--mw = {CFrame.new(-0.2264328, 0.0250015259, -0.604776859, 0.98480773, 0, 0.173648193, 0, 1, 0, -0.173648193, 0, 0.98480773), easingstyles.Sine, easingdirs.In},
			bw = {CFrame.new(-0.299999237, 0.104995728, 0.0449981689, 1, 3.33557523e-06, 2.00149793e-06, -3.33557591e-06, 1, 3.57635798e-07, -2.0014968e-06, -3.57642477e-07, 1), easingstyles.Sine, easingdirs.In},
			hw = {CFrame.new(-0.055809021, 0, -0.0665130615, 0.864329457, -0.11161875, 0.490383387, 0.03015358, 0.984807789, 0.171009868, -0.502021194, -0.133022055, 0.854564071), easingstyles.Sine, easingdirs.In},
			gw = {CFrame.new(-0.0572328568, -0.980491638, -0.278923035, 0.0310192183, 0.998318493, 0.0487680063, 0.937351048, -0.0121154999, -0.34816578, -0.346991748, 0.0565129519, -0.936161935), easingstyles.Sine, easingdirs.In},
			raw = {CFrame.new(1.11267471, -0.963647842, -0.780944824, 0.96286577, 0.230811596, -0.140053496, -0.10095071, -0.173324212, -0.979677141, -0.250395477, 0.957436204, -0.143587425) * CFrame.new(0.2,0,0) * CFrame.new(0,0,0.5) * CFrame.Angles(0,-0.05,0), easingstyles.Sine, easingdirs.In},
			law = {CFrame.new(-0.289166451, -0.800122261, -1.59056854, 0.533511698, -0.820919991, -0.203605846, -0.0797704309, 0.190816656, -0.978378952, 0.842022419, 0.53821826, 0.0363177806) * CFrame.new(0,0,0.5) * CFrame.new(0,0,0), easingstyles.Sine, easingdirs.In},
		},
		[3] = {
			--mw = {CFrame.new(-0.2264328, 0.0250015259, -0.604776859, 0.98480773, 0, 0.173648193, 0, 1, 0, -0.173648193, 0, 0.98480773), easingstyles.Sine, easingdirs.In},
			bw = {CFrame.new(-0.299999237, 0.104995728, 0.0449981689, 1, 3.33557523e-06, 2.00149793e-06, -3.33557591e-06, 1, 3.57635798e-07, -2.0014968e-06, -3.57642477e-07, 1), easingstyles.Sine, easingdirs.Out},
			hw = {CFrame.new(-0.055809021, 0, -0.0665130615, 0.936352491, -0.11161875, 0.332844049, 0.0593910292, 0.984807789, 0.163175717, -0.34600088, -0.133022055, 0.928756297), easingstyles.Sine, easingdirs.Out},
			gw = {CFrame.new(-0.0572328568, -0.980491638, -0.278923035, 0.0310192183, 0.998318493, 0.0487680063, 0.937351048, -0.0121154999, -0.34816578, -0.346991748, 0.0565129519, -0.936161935), easingstyles.Sine, easingdirs.Out},
			raw = {CFrame.new(0.951341629, -1.00614738, -0.96661377, 0.887119889, 0.393562078, -0.241094485, -0.185951054, -0.173324212, -0.967150807, -0.422421396, 0.902810454, -0.0805761442) * CFrame.new(0.3,0,0) * CFrame.new(0,0,0.5) * CFrame.Angles(0,-0.1,0), easingstyles.Sine, easingdirs.Out},
			law = {CFrame.new(-0.798740387, -0.729963303, -1.94239807, 0.788041711, -0.601489127, -0.131151706, -0.0967602059, 0.0893746093, -0.991286814, 0.60796994, 0.793865442, 0.0122306943) * CFrame.new(0,0,0.5) * CFrame.new(0.5,0,-0.4), easingstyles.Sine, easingdirs.Out},
		},
		[4] = {
			--mw = {CFrame.new(-0.2264328, 0.0250015259, -0.604776859, 0.98480773, 0, 0.173648193, 0, 1, 0, -0.173648193, 0, 0.98480773), easingstyles.Sine, easingdirs.In},
			bw = {CFrame.new(-0.299999237, 0.104995728, 0.0449981689, 1, 3.33557523e-06, 2.00149793e-06, -3.33557591e-06, 1, 3.57635798e-07, -2.0014968e-06, -3.57642477e-07, 1), easingstyles.Sine, easingdirs.In},
			hw = {CFrame.new(-0.055809021, 0, -0.0665130615, 0.936352491, -0.11161875, 0.332844049, 0.0593910292, 0.984807789, 0.163175717, -0.34600088, -0.133022055, 0.928756297), easingstyles.Sine, easingdirs.In},
			gw = {CFrame.new(-0.0572328568, -0.980491638, -0.278923035, 0.0310192183, 0.998318493, 0.0487680063, 0.937351048, -0.0121154999, -0.34816578, -0.346991748, 0.0565129519, -0.936161935), easingstyles.Sine, easingdirs.In},
			raw = {CFrame.new(0.951341629, -1.00614738, -0.96661377, 0.887119889, 0.393562078, -0.241094485, -0.185951054, -0.173324212, -0.967150807, -0.422421396, 0.902810454, -0.0805761442) * CFrame.Angles(0,-0.45,0) * CFrame.new(0,0,0.5) * CFrame.Angles(0,-0.15,0), easingstyles.Sine, easingdirs.In},
			law = {CFrame.new(-0.733897209, -0.698638916, -1.94715118, 0.733374, -0.676505506, -0.0670995787, -0.0810378194, 0.0110032074, -0.996650279, 0.67497766, 0.736355007, -0.0467530787) * CFrame.new(0,0,0.5) * CFrame.Angles(0.15,0,0) * CFrame.new(-0.1,0,0), easingstyles.Sine, easingdirs.In},
		},
		[5] = {
			--mw = {CFrame.new(-0.2264328, 0.0250015259, -0.604776859, 0.98480773, 0, 0.173648193, 0, 1, 0, -0.173648193, 0, 0.98480773), easingstyles.Sine, easingdirs.In},
			bw = {CFrame.new(-0.299999237, 0.104995728, 0.0449981689, 1, 3.33557523e-06, 2.00149793e-06, -3.33557591e-06, 1, 3.57635798e-07, -2.0014968e-06, -3.57642477e-07, 1), easingstyles.Sine, easingdirs.Out},
			hw = {CFrame.new(-0.055809021, 0, -0.0665130615, 0.936352491, -0.11161875, 0.332844049, 0.0593910292, 0.984807789, 0.163175717, -0.34600088, -0.133022055, 0.928756297), easingstyles.Sine, easingdirs.Out},
			gw = {CFrame.new(-0.0572328568, -0.980491638, -0.278923035, 0.0310192183, 0.998318493, 0.0487680063, 0.937351048, -0.0121154999, -0.34816578, -0.346991748, 0.0565129519, -0.936161935), easingstyles.Sine, easingdirs.Out},
			raw = {CFrame.new(0.956790924, -0.985137939, -0.964424133, 0.887119889, 0.382671088, -0.258031964, -0.185951054, -0.215345785, -0.95867002, -0.422421396, 0.898436666, -0.119879492) * CFrame.Angles(0,-0.55,0) * CFrame.new(0,0,0.4) * CFrame.Angles(0,-0.1,0), easingstyles.Sine, easingdirs.Out},
			law = {CFrame.new(-0.702912331, -0.529985428, -1.91860962, 0.691018224, -0.696123064, -0.194694132, -0.3362284, -0.0711144507, -0.939091682, 0.639877796, 0.714391232, -0.28319779) * CFrame.new(0,0,0.5) * CFrame.new(0.1,0,0), easingstyles.Sine, easingdirs.Out},
		}
	},
	aim = {
		[1] = {
			bw = {CFrame.new(-0.299999237, 0.104995728, 0.0449981689, 1, 3.33557523e-06, 2.00149793e-06, -3.33557591e-06, 1, 3.57635798e-07, -2.0014968e-06, -3.57642477e-07, 1), easingstyles.Back, easingdirs.Out},
			hw = {CFrame.new(0, 0, 0, 0.642787635, 0, 0.766044438, 0, 1, 0, -0.766044438, 0, 0.642787635), easingstyles.Sine, easingdirs.Out},
			gw = {CFrame.new(-0.209030151, -1.02510452, -0.225169182, 9.54675698e-08, 0.99999994, 8.86497986e-10, 0.939692557, -1.49011612e-07, -0.342020124, -0.342020124, 3.348487e-08, -0.939692557), easingstyles.Sine, easingdirs.Out},
			raw = {CFrame.new(0.659713745, -1.45935869, 0.354370117, 0.99999994, -2.98023224e-08, 3.35276127e-08, 3.53902578e-08, -3.21306288e-08, -0.999999881, -2.98023224e-08, 1, -3.0035153e-08), easingstyles.Sine, easingdirs.Out},
			law = {CFrame.new(-0.000568389893, -1.6040411, -2.10723114, -0.0793336332, -0.53615725, 0.840381742, 0.862421989, -0.459712416, -0.211878672, 0.499934286, 0.707954705, 0.498864472), easingstyles.Sine, easingdirs.Out},
		}
	},
	--individual poses
	reloadmag = {
		[1] = {
			mag = {CFrame.new(0.383216858, 0.00605773926, -0.895876884, 0.982579589, -0.0196594987, -0.184799746, 0.0194191728, 0.999806643, -0.00311047747, 0.184825167, -0.000532366452, 0.982771337), easingstyles.Sine, easingdirs.In}
		},
		[2] = {
			mag = {CFrame.new(-0.341659546, -0.00597381592, -0.82459569, 0.943051159, -0.0805884004, 0.32273832, 0.108094886, 0.99179846, -0.0682025552, -0.314594954, 0.0992048606, 0.944027781) * CFrame.new(-0.2,0.1,0), easingstyles.Sine, easingdirs.Out}
		},
		[3] = {
			mag = {CFrame.new(-0.343078613, 0.033826828, -0.555139065, 0.931312561, -0.056615673, 0.359807789, 0.0651112646, 0.997804642, -0.0115158707, -0.358372539, 0.0341522247, 0.932950974) * CFrame.Angles(0,0.3,0) * CFrame.new(-0.3,0.2,0), easingstyles.Sine, easingdirs.In}
		},
		[4] = {
			mag = {CFrame.new(-0.226425171, 0.0250015259, -0.604773998, 0.984800279, 1.56462193e-06, 0.173645124, 1.68196857e-06, 0.999979436, -5.66244125e-07, -0.173649177, -8.04662704e-07, 0.984803438), easingstyles.Sine, easingdirs.Out}
		}
	}
}

function clonemag(parent, name)
	local clonedmag = magcmodel:Clone()
	local clonedmagpart = clonedmag:WaitForChild("magpart")
	clonedmag.Name = name
	clonedmag.Parent = parent
	return clonedmag, clonedmagpart
end

function tween(speed, easingstyle, easingdirection, loopcount, reverseafterfinish, delaytime, WHAT, goal)
	local info = TweenInfo.new(speed, easingstyle, easingdirection, loopcount, reverseafterfinish, delaytime)
	local goals = goal
	local anim = tweenservice:Create(WHAT, info, goals)
	anim:Play()
end

function linearlerp(a,b,t)
	return a+(b-a)*t
end

function clientdropshell()
	local shell = Instance.new("SpawnLocation", gunmodel) --spawnlocation because its one of the only baseparts that dont go under tusks basepart limit
	shell.Enabled = false
	shell.Name = "shell;"
	shell.Shape = "Cylinder"
	shell.Size = Vector3.new(0.25,0.1,0.1)
	shell.BrickColor = BrickColor.new("New Yeller")
	shell.Material = "Glass"
	shell.Anchored = true
	shell.CanCollide = false
	shell.CFrame = boltcweld.Part1.CFrame * CFrame.new(0.1,0,0)
	shell:BreakJoints()
	local shellfunc
	local shelltimepassed = 0
	local playedshells = false
	local currentshelly = math.random(1,10)/5
	local currentshellx = math.random(8,15)
	local ejectlookv = boltcweld.Part1.CFrame.upVector
	local ejectrightv = boltcweld.Part1.CFrame.rightVector
	shellfunc = runservice.Stepped:Connect(function(_, delta)
		shelltimepassed = shelltimepassed + delta
		shell.CFrame = CFrame.new(shell.Position, shell.Position+ejectlookv) 
			* CFrame.new(0,currentshelly*delta,-currentshellx*delta)
		shell.CFrame = CFrame.new(shell.Position, shell.Position+ejectrightv) 
			* CFrame.Angles(0,math.pi/2,0)
		currentshelly = currentshelly - delta*shellfallspeed
		if shelltimepassed > shellflytime then
			shell:Destroy()
			shellfunc:Disconnect()
		end
	end)
end

function pemit(part, color, minsize, maxsize, minlift, maxlift, speed, direction, lifetime)
	pcall(function() --tusk has a particle emitter limit thats why im pcalling
		local em = Instance.new("ParticleEmitter", part)
		em.Color = ColorSequence.new(color)
		em.Texture = "rbxassetid://375847957"
		em.Name = "gemit"
		em.Drag = 10
		em.EmissionDirection = direction
		em.Speed = NumberRange.new(speed)
		em.Rate = 500
		em.Lifetime = NumberRange.new(minlift,maxlift)
		em.SpreadAngle = Vector2.new(-20,20)
		em.Transparency = NumberSequence.new(0.75, 1)
		em.Size = NumberSequence.new(minsize, maxsize)
		task.spawn(function()
			task.wait(lifetime)
			em.Enabled = false
			debris:AddItem(em, 0.5)
		end)
	end)
end

function muzzleflash(size, transparency)
	local e = Instance.new("SpawnLocation", gunmodel) --spawnlocation because its one of the only baseparts that dont go under tusks basepart limit
	e.Enabled = false
	Instance.new("SpecialMesh", e).MeshType = Enum.MeshType.Sphere
	local lig = Instance.new("PointLight", e)
	lig.Brightness = 1-transparency
	e.Size = size
	e.Transparency = transparency
	e.CanCollide = false
	e.Anchored = true
	e.Material = Enum.Material.Neon
	e.CFrame = gunclufa.CFrame * CFrame.new((-size.x/2)-0.3,0,0)
	pemit(gunclufa, Color3.fromRGB(255,255,255), 0.15, 0.35, 0.1, 0.2, 10, "Left", 0.1)
	debris:AddItem(e, 0.025)
end

function cpose(posname, posnumb, speed, backupt)
	if equiptick == backupt then
		if currentlyfps then
			if posname == "shoot" and posnumb == 1 then
				clientdropshell()
				muzzleflash(Vector3.new(2,0.6,0.6), math.random(1,15)/10)
				if adsing then
					offset = offset * CFrame.new(0,0,0.05) * CFrame.Angles(0,0,0.015)
				else
					offset = offset * CFrame.new(0,0,0.1) * CFrame.Angles(0,0,0.03)
				end
			elseif posname == "equip" and posnumb == 2 then
				recoiltick = tick()
				recoilup(0, -0.35, 1, 0.3, recoiltick)
				if bchambered.Value > 0 then
					clientdropshell()
				end
			elseif posname == "reload" then
				if posnumb == 1 then
					recoilup(-0.7, 0.3, -1, 0.4, recoiltick)
				end
			end
		end
		tween(speed, poses[posname][posnumb].raw[2], poses[posname][posnumb].raw[3], 0, false, 0, rarmcweld, {C0 = poses[posname][posnumb].raw[1]})
		tween(speed, poses[posname][posnumb].law[2], poses[posname][posnumb].law[3], 0, false, 0, larmcweld, {C0 = poses[posname][posnumb].law[1]})
		tween(speed, poses[posname][posnumb].gw[2], poses[posname][posnumb].gw[3], 0, false, 0, guncweld, {C0 = poses[posname][posnumb].gw[1]})
		tween(speed, poses[posname][posnumb].bw[2], poses[posname][posnumb].bw[3], 0, false, 0, boltcweld, {C0 = poses[posname][posnumb].bw[1]})
	end
end

function ciposeconvert(posname, posnumb, posdir, speed, backupt)
	if equiptick == backupt then
		if posname == "reloadmag" then
			if posnumb == 1 then
				reloadmagcmodel, reloadmagcpart = clonemag(guncmodel, "mag")
				reloadmagcweld = Instance.new("Weld", reloadmagcmodel)
				reloadmagcweld.Name = "handmagweld"
				reloadmagcweld.Part0 = maincpart
				reloadmagcweld.Part1 = reloadmagcpart
				reloadmagcweld.C0 = CFrame.new(0.771263123, -2.07442856, -2.45114708, 0.108410954, 0.822345078, -0.558561325, -0.0455624163, 0.565389991, 0.823553741, 0.993062019, -0.0638353601, 0.0987635553)
				if not currentlyfps then
					modeltransparency(reloadmagcmodel, 1)
				end	
			elseif posnumb == 3 then
				local flingmagm, flingmagp = clonemag(guncmodel, "throw")
				local magv = Instance.new("BodyVelocity", flingmagp)
				magv.MaxForce = Vector3.new(1/0,1/0,1/0)
				magv.Velocity = (mainpart.CFrame.lookVector*-math.random(5,10)) + (mainpart.CFrame.rightVector*-math.random(10,20)) + (mainpart.CFrame.upVector*-math.random(10,20))
				local magav = Instance.new("BodyAngularVelocity", flingmagp)
				magav.MaxTorque = Vector3.new(1/0,1/0,1/0)
				magav.AngularVelocity = hrp.CFrame.rightVector*math.random(15,20)
				debris:AddItem(magv, 0.1)
				debris:AddItem(flingmagp, 0.5)
				if not currentlyfps then
					modeltransparency(flingmagm, 1)
				end
				modeltransparency(magcmodel, 1)
			elseif posnumb == 4 then
				task.spawn(function()
					task.wait(0.2)
					reloadmagcmodel:Destroy()
					if currentlyfps then
						modeltransparency(magcmodel, 0)
					end
				end)
			end
		end
		tween(speed, poses[posname][posnumb][posdir][2], poses[posname][posnumb][posdir][3], 0, false, 0, reloadmagcweld, {C0 = poses[posname][posnumb][posdir][1]})
	end
end

function movec(cf)
	cam.CFrame = cam.CFrame * cf
end

function recoilup(xm, ym, zm, t, tic)
	local firsttick = tick()
	task.spawn(function()
		while runservice.RenderStepped:wait() and tick() < firsttick + t and recoiltick == tic do
			movec(recoilcf:Inverse())
			recoilcf = recoilcf * CFrame.Angles(
				(xm*delta*(recmult/recdampmult))*((t+firsttick)-tick()), --x
				(ym*delta*(recmult/recdampmult))*((t+firsttick)-tick()), --y
				(zm*delta*(recmult/recdampmult))*((t+firsttick)-tick())  --z
			)
			movec(recoilcf)
		end
	end)
end

remote.OnClientEvent:Connect(function(WHAT, param, param2, param3, param4)
	if state ~= "unequipped" then
		if WHAT == "recoil" then
			recoiltick = tick()
			recoilup(recxamount, (math.random(-10,10)/10)*recyamount, (math.random(-10,10)/10)*reczamount, rectime, recoiltick)
		elseif WHAT == "fromserverpose" then
			cpose(param, param2, param3, equiptick)
		elseif WHAT == "fromserverindividualpose" then
			ciposeconvert(param, param2, param3, param4, equiptick)
		end
	end
end)

function ads(enable)
	if enable and not adsing and hrp.Velocity.Magnitude < 17 and (head.CFrame.p - cam.CFrame.p).Magnitude < 1.7 then
		adsing = true
		recmult = recmult/2
		remote:FireServer("5", true)
	elseif not enable and adsing then
		adsing = false
		recmult = recmult*2
		remote:FireServer("5", false)
	end
end

function makefpsviewmodel()
	viewmodel = Instance.new("Model", cam)
	viewmodel.Name = "gunviewmodel"
	Instance.new("Humanoid", viewmodel)
	local mainpart = Instance.new("Part", viewmodel)
	mainpart.Anchored = true
	mainpart.CanCollide = false
	mainpart.Transparency = 1
	mainpart.Size = Vector3.new()
	--
	local rarm = Instance.new("Part", viewmodel)
	rarm.Size = Vector3.new(0.7,2,0.7)
	rarm.Color = character["Right Arm"].Color
	rarm.CanCollide = false
	rarm.Name = "Right Arm"
	local larm = Instance.new("Part", viewmodel)
	larm.Size = Vector3.new(0.7,2,0.7)
	larm.Color = character["Left Arm"].Color
	larm.CanCollide = false
	larm.Name = "Left Arm"
	local gunclone = gunmodel:Clone()
	local gunchandle = gunclone:WaitForChild("Handle")
	local guncmainpart = gunclone:WaitForChild("mainpart")
	gunclufa = gunclone:WaitForChild("lufa")
	maincpart = guncmainpart
	guncmodel = gunclone
	boltcweld = guncmainpart:WaitForChild("boltweld")
	magcmodel = gunclone:WaitForChild("mag")
	gunclone.Parent = viewmodel
	for i,v in pairs(gunclone:GetDescendants()) do
		if v:IsA("BasePart") then
			v.CanCollide = false
			v.Anchored = false
		end
	end
	--
	larmcweld = Instance.new("Weld", mainpart)
	larmcweld.Part0 = mainpart
	larmcweld.Part1 = larm
	larmcweld.C0 = CFrame.new(1,-2.5,0)
	rarmcweld = Instance.new("Weld", mainpart)
	rarmcweld.Part0 = mainpart
	rarmcweld.Part1 = rarm
	rarmcweld.C0 = CFrame.new(1,-2.5,0)
	guncweld = Instance.new("Weld", mainpart)
	guncweld.Part0 = rarm
	guncweld.Part1 = gunchandle
	guncweld.C0 = CFrame.new(1,-2.5,0)
	pcall(function()
		character["Shirt"]:Clone().Parent = viewmodel
	end)
	gunmodel.DescendantAdded:Connect(function(WHAT)
		if (cam.CFrame.p - head.Position).magnitude < 1.3 then
			if WHAT.Name == "throwserver" or WHAT.Name == "reloadserver" then
				WHAT:WaitForChild("Part")
				modeltransparency(WHAT, 1)
			elseif WHAT:IsA("ParticleEmitter") and WHAT.Name == "gemit" then
				WHAT.Transparency = NumberSequence.new(1)
			elseif WHAT:IsA("BasePart") and WHAT.Name == "muzzleflash" or WHAT.Name == "shell;" then
				WHAT.Transparency = 1
			elseif WHAT:IsA("PointLight") and WHAT.Name == "mflash" then
				WHAT.Brightness = 0
			end
		end
	end)
	modeltransparency(viewmodel, 1)
	return mainpart
end

tool.Equipped:Connect(function()
	state = "equipped"
	equiptick = tick()
	local backuptick = equiptick
	local ticktofireserver = 0
	local lastcameracf = cam.CFrame
	savedfov = cam.FieldOfView
	offset = CFrame.new()
	character = owner.Character
	gui.Parent = ownergui
	local mpart = makefpsviewmodel()
	mouse.TargetFilter = mpart.Parent
	chamberedgui.Text = tostring(bchambered.Value)
	ammogui.Text = tostring(binmag.Value)
	maggui.Text = tostring(magleft.Value)
	humanoid = character:FindFirstChildOfClass("Humanoid")
	head = character.Head
	hrp = character.HumanoidRootPart
	humanoid.AutoRotate = false
	rstepgun = runservice.RenderStepped:Connect(function()
		if state ~= "unequipped" and humanoid.Health > 0 and equiptick == backuptick then
			delta = tick() - frametick
			movec(recoilcf:Inverse())
			hrp.CFrame = hrp.CFrame:lerp(CFrame.new(hrp.Position, Vector3.new(mouse.Hit.p.x,hrp.Position.y,mouse.Hit.p.z)),delta*15)
			recoilcf = recoilcf:lerp(CFrame.new(),delta*currentcspeed)
			movec(recoilcf)
			humanoid.CameraOffset = Vector3.new()
			if (cam.CFrame.p - head.Position).magnitude < 1.3 and not currentlyfps then
				humanoid.CameraOffset = Vector3.new(0,0.4,0)
				guntransparency(1)
				modeltransparency(viewmodel, 0)
				currentlyfps = true
			elseif (cam.CFrame.p - head.Position).magnitude > 1.3 and currentlyfps then
				guntransparency(0)
				modeltransparency(viewmodel, 1)
				if adsing then
					ads(false)
				end
				currentlyfps = false
			end
			local relative = cam.CFrame:ToObjectSpace(lastcameracf)
			local camx,camy,camz = relative:ToOrientation()
			local relativevel = hrp.CFrame:vectorToObjectSpace(hrp.Velocity)
			local clampvelx, clampvelz, clampvely = math.clamp(relativevel.x, -35, 35), math.clamp(relativevel.z, -35, 35), math.clamp(relativevel.y, -50, 50)
			local crelativevel = Vector3.new(clampvelx, 0, clampvelz)
			if adsing then
				offset = offset:lerp(CFrame.Angles(camx/2, camy/2, -camy/2) * CFrame.new(-0.45,0.4,0.25), delta*5)
				cam.FieldOfView = linearlerp(cam.FieldOfView, 35, delta*4)
			else
				offset = offset:lerp(CFrame.Angles(camx/2, camy/2, -camy/2), delta*10)
				cam.FieldOfView = linearlerp(cam.FieldOfView, 70+(Vector3.new(hrp.Velocity.x,0,hrp.Velocity.z).Magnitude/5), delta*5)
			end
			if crelativevel.Magnitude > 0.1 then
				if crelativevel.Magnitude < 19 or state == "shooting" then
					offset = offset:lerp(CFrame.Angles(
						(camx/2), 
						camy/2-math.cos(tick()*7)*(crelativevel.Magnitude/350), 
						(-camy/2)+math.sin(tick()*7)*(crelativevel.Magnitude/120)-(clampvelx/60)) 
							* CFrame.new(
								math.sin(tick()*7)*(crelativevel.Magnitude/250),
								-math.cos(tick()*14)*(crelativevel.Magnitude/250),
								0), delta*5)
				elseif state ~= "shooting" and humanoid.FloorMaterial ~= Enum.Material.Air then
					if adsing then
						ads(false)
					end
					offset = offset:lerp(CFrame.Angles(
						camx/2, 
						camy/2-math.cos(tick()*10)*(crelativevel.Magnitude/250), 
						(-camy/2)+math.sin(tick()*10)*(crelativevel.Magnitude/70)-(clampvelx/60)) 
							* CFrame.new(
								1+math.sin(tick()*10)*(crelativevel.Magnitude/150),
								-0.4-math.cos(tick()*20)*(crelativevel.Magnitude/150),
								0)
							* CFrame.Angles(
								math.rad(-20),
								(math.pi/2),
								0), delta*10)
				end
			end
			mpart.CFrame = cam.CFrame * offset
			lastcameracf = cam.CFrame
			ticktofireserver = ticktofireserver + delta
			if ticktofireserver > 0.1 then
				remote:FireServer("1", (mouse.Hit.p-head.CFrame.p).unit.y)
				ticktofireserver = 0
			end
		else
			rstepgun:Disconnect()
		end
		frametick = tick()
	end)
end)
mouse.KeyDown:Connect(function(key)
	if state == "equipped" then
		key = key:lower()
		if key == "f" then
			remote:FireServer("3")
		elseif key == "r" then
			remote:FireServer("4")
		elseif key:byte() == 48 then
			remote:FireServer("6", true)
		end
	end
end)
mouse.KeyUp:Connect(function(key)
	if state == "equipped" then
		key = key:lower()
		if key:byte() == 48 then
			remote:FireServer("6", false)
		end
	end
end)
mouse.Button2Down:Connect(function()
	if state ~= "unequipped" then
		ads(true)
	end
end)
mouse.Button2Up:Connect(function()
	if state ~= "unequipped" then
		ads(false)
	end
end)
tool.Activated:Connect(function()
	if state == "equipped" then
		shoottick = tick()
		state = "shooting"
		local btick = shoottick
		while shoottick == btick and state == "shooting" and humanoid.Health > 0 do
			if binmag.Value > 0 or bchambered.Value > 0 then
				remote:FireServer("2", mouse.Hit.p)
				task.wait(gunspeed.Value)
			else break end
		end
		if state == "shooting" then
			state = "equipped"
		end
	end
end)
tool.Deactivated:Connect(function()
	if state == "shooting" then
		state = "equipped"
	end
end)
tool.Unequipped:Connect(function()
	state = "unequipped"
	gui.Parent = tool
	viewmodel:Destroy()
	guntransparency(0)
	if adsing then
		ads(false)
	end
	cam.FieldOfView = savedfov
	currentlyfps = false
	recoilcf = CFrame.new()
	humanoid.AutoRotate = true
end)
