Advertisement
iiFlamez

Untitled

Sep 3rd, 2016
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 35.69 KB | None | 0 0
  1.  
  2. plr=game:service'Players'.LocalPlayer
  3. ch,char=plr.Character,plr.Character
  4. hum=ch.Humanoid
  5. tor,torso,rootpart,rj=ch.Torso,ch.Torso,ch.HumanoidRootPart,ch.HumanoidRootPart.RootJoint
  6. m,mouse=plr:GetMouse(),plr:GetMouse()
  7. cfn,ang,mr,int=CFrame.new,CFrame.Angles,math.rad,Instance.new
  8. bc=BrickColor.new
  9. head=ch.Head
  10. cam=workspace.CurrentCamera
  11.  
  12. rj.C0=cfn()
  13. rj.C1=cfn()
  14.  
  15. sheathed=false
  16. jammed=false
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28. local minimumsize = Vector3.new(0.7,0.7,0.7) --Minimumsize for a part to get divided,higher numbers = less detailed and bigger/less bricks
  29. local surface_between_splitted_parts = 'SmoothNoOutlines' --the surface between splitted parts
  30. --local fragmented = workspace:FindFirstChild("Fragmented")
  31. local fragmentable = workspace --all fragmentable objects should be stored in here
  32. local list = {}
  33. local brickcount = 0
  34. --local m = Instance.new("Hint",workspace)
  35. local storage = {}
  36. local fillup = 1000 --it constantly generates new parts until it reaches this number(hacky way to prevent lagspikes if there is a large explosion),change it to 0 if you don´t want it to generate (useless) parts.
  37. local maximumstorage = 2000 --it will recycle parts if the number of parts in the storage doesnt exceed this number
  38. local storage_position = Vector3.new(0,0,5000) --place them somewhere off the map
  39. local stored_partsize = Vector3.new(1,1,1) --make them small
  40. local parts_created_per_frame = 5 --number of parts being created per frame to fill up the storage
  41.  
  42.  
  43. function fragmentate(cframe,size,color,explosion_position,explosion_blastradius,backsurface,bottomsurface,frontsurface,leftsurface,rightsurface,topsurface,transparency,reflectance)
  44. local xi = size.X >= minimumsize.X*(1+explosion_blastradius/16) and 2 or 1 --to reduce the lagg in large explosions we increase minimumsize based on the explosionradius...
  45. local yi = size.Y >= minimumsize.Y*(1+explosion_blastradius/16) and 2 or 1
  46. local zi = size.Z >= minimumsize.Z*(1+explosion_blastradius/16) and 2 or 1
  47. if xi == 1 and yi == 1 and zi == 1 or (cframe.p-explosion_position).magnitude > size.magnitude/2 + explosion_blastradius then --don´t fragmentate parts, that are too small to fragmentate or too far away from the explosion
  48. if xi == 1 and yi == 1 and zi == 1 then return end --optional
  49. if #storage > 0 then
  50. local p = storage[1]
  51. p.BrickColor = color
  52. p.Size = size
  53. p.BackSurface = backsurface
  54. p.BottomSurface = bottomsurface
  55. p.FrontSurface = frontsurface
  56. p.LeftSurface = leftsurface
  57. p.RightSurface = rightsurface
  58. p.TopSurface = topsurface
  59. p.Transparency = transparency
  60. p.CFrame = cframe
  61. p.Reflectance = reflectance
  62. table.remove(storage,1)
  63. else
  64. local p = Instance.new("Part",fragmentable)
  65. p.BrickColor = color
  66. p.FormFactor = "Custom"
  67. p.Size = size
  68. p.BackSurface = backsurface
  69. p.BottomSurface = bottomsurface
  70. p.FrontSurface = frontsurface
  71. p.LeftSurface = leftsurface
  72. p.RightSurface = rightsurface
  73. p.TopSurface = topsurface
  74. p.Transparency = transparency
  75. if p.Transparency>0.285 then
  76. p.Anchored = false
  77. else
  78. p.Anchored=true
  79. p.Material='Wood'
  80. end
  81. p.CFrame = cframe
  82. p.Reflectance = reflectance
  83. end
  84. --p:MakeJoints()
  85. -- m.Text = m.Text+1
  86. return --stop the function
  87. end
  88. local mody = math.random(-125,125)/1000 --some randomization
  89. for y = 1,yi do
  90. if math.random()> 0.5 then
  91. local modx = math.random(-125,125)/1000
  92. for x = 1,xi do
  93. local modz = math.random(-125,125)/1000
  94. for z = 1,zi do --offset = x/xi-0.75+modx)
  95. fragmentate(cframe*CFrame.new(size.X*(xi==1 and 0 or x/xi-0.75+modx),size.Y*(yi==1 and 0 or y/yi-0.75+mody),size.Z*(zi==1 and 0 or z/zi-0.75+modz)), --maths
  96. Vector3.new(xi == 2 and size.X*(1-2*math.abs(x/xi-0.75+modx)) or size.X,yi == 2 and size.Y*(1-2*math.abs(y/yi-0.75+mody)) or size.Y,
  97. zi == 2 and size.Z*(1-2*math.abs(z/zi-0.75+modz)) or size.Z or agent767_was_here),color,explosion_position,explosion_blastradius,
  98. z~=zi and surface_between_splitted_parts or backsurface,y==2 and surface_between_splitted_parts or bottomsurface,
  99. z==2 and surface_between_splitted_parts or frontsurface,x==2 and surface_between_splitted_parts or leftsurface,x~=xi and surface_between_splitted_parts or rightsurface,
  100. y~=yi and surface_between_splitted_parts or topsurface,transparency,reflectance)
  101. end
  102.  
  103. end
  104. else
  105. local modz = math.random(-125,125)/1000
  106. for z = 1,zi do
  107. local modx = math.random(-125,125)/1000
  108. for x = 1,xi do
  109. fragmentate(cframe*CFrame.new(size.X*(xi==1 and 0 or x/xi-0.75+modx),size.Y*(yi==1 and 0 or y/yi-0.75+mody),size.Z*(zi==1 and 0 or z/zi-0.75+modz)),
  110. Vector3.new(xi == 2 and size.X*(1-2*math.abs(x/xi-0.75+modx)) or size.X,yi == 2 and size.Y*(1-2*math.abs(y/yi-0.75+mody)) or size.Y,
  111. zi == 2 and size.Z*(1-2*math.abs(z/zi-0.75+modz)) or size.Z),color,explosion_position,explosion_blastradius,
  112. z~=zi and surface_between_splitted_parts or backsurface,y==2 and surface_between_splitted_parts or bottomsurface,
  113. z==2 and surface_between_splitted_parts or frontsurface,x==2 and surface_between_splitted_parts or leftsurface,x~=xi and surface_between_splitted_parts or rightsurface,
  114. y~=yi and surface_between_splitted_parts or topsurface,transparency,reflectance)
  115. end
  116. end
  117. end
  118. end
  119. end
  120.  
  121. function start_fragmentation(position,radius)
  122. local search = Region3.new(position-Vector3.new(radius,radius,radius)*1.1,position+Vector3.new(radius,radius,radius)*1.1)
  123. repeat
  124. local finish = false
  125. local parts = workspace:FindPartsInRegion3WithIgnoreList(search,list,100) --maximum number of parts that FindPartsInRegion3 can find is 100, so we have to do this to find them all
  126. for i = 1,#parts do
  127. table.insert(list,1,parts[i])
  128. end
  129. finish = true
  130. until #parts < 100 and finish
  131. print(#list)
  132. local t = tick()
  133. for i = 1,#list do
  134. local p = list[i]
  135. if p:IsDescendantOf(fragmentable) and p:GetMass()<3000 and p.Transparency>0.285 and p.Name~='Base' and p:IsDescendantOf(ch)==false then
  136. fragmentate(p.CFrame,p.Size,p.BrickColor,position,radius,p.BackSurface,p.BottomSurface,p.FrontSurface,p.LeftSurface,p.RightSurface,p.TopSurface,p.Transparency,p.Reflectance)
  137. if #storage < maximumstorage and p.Shape == "Block" then --recycle them
  138. p.Anchored = false
  139. p.FormFactor = "Custom"
  140. p.Size = stored_partsize
  141. p.Position = storage_position
  142. table.insert(storage,1,p)
  143. else --storage is full
  144. p:Destroy()
  145. end
  146. -- m.Text = m.Text-1
  147. end
  148. if p:IsDescendantOf(fragmentable) and p:GetMass()<53000 and p.Transparency<0.05 and p.Name~='Base' and tostring(p.Material)=='Enum.Material.Wood' and p:IsDescendantOf(ch)==false then
  149. fragmentate(p.CFrame,p.Size,p.BrickColor,position,radius,p.BackSurface,p.BottomSurface,p.FrontSurface,p.LeftSurface,p.RightSurface,p.TopSurface,p.Transparency,p.Reflectance)
  150. if #storage < maximumstorage and p.Shape == "Block" then --recycle them
  151. p.Anchored = true
  152. p.Material='Wood'
  153. p.FormFactor = "Custom"
  154. p.Size = stored_partsize
  155. p.Position = storage_position
  156. table.insert(storage,1,p)
  157. else --storage is full
  158. p:Destroy()
  159. end
  160. -- m.Text = m.Text-1
  161. end
  162. end
  163. list = {}
  164. -- print(tick()-t)
  165. end
  166.  
  167. --[[
  168. spawn(function()
  169. while wait() do --oh noes,a loop! So inefficient!
  170. if #storage < fillup then
  171. for i = 1, parts_created_per_frame do --creates parts to fill up the storage
  172. local p = Instance.new("Part",fragmentable)
  173. p.Anchored = false
  174. p.FormFactor = "Custom"
  175. p.Size = stored_partsize
  176. p.Position = storage_position
  177. table.insert(storage,1,p)
  178. end
  179. end
  180. end
  181. end)
  182. ]]
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206. --local blankn=22416261
  207.  
  208. --172121567
  209.  
  210. crosshairs={
  211. {38140824};
  212. {38140833};
  213. {38140839};
  214. {38140843};
  215. {38140852};
  216. {38140910};
  217. {38140915};
  218. {38140923};
  219. {38140928};
  220. {38140931};
  221. {38208259};
  222. {38208275};
  223. {38208284};
  224. {38208303};
  225. {38208310};
  226. {38208325};
  227. {38208330};
  228. {38208352};
  229. {38208359};
  230. {38208377}
  231. }
  232.  
  233. bulletholes={
  234. 172274695;
  235. 172274721
  236. }
  237.  
  238. for _,v in pairs(crosshairs) do
  239. game:service'ContentProvider':Preload('rbxassetid://' .. tostring(v[1]-1))
  240. end
  241.  
  242. currentIco=2
  243. switchIco=function(num)
  244. if num<20 then
  245. else
  246. num=20
  247. end
  248. mouse.Icon='rbxassetid://' .. tostring(crosshairs[num][1]-1)
  249. currentIco=num
  250. end
  251.  
  252. switchIco(currentIco)
  253.  
  254. heldDown=false
  255.  
  256. spreadint=1
  257. --[[Settings]]--
  258. recoil=false -- Set to true for added realism
  259. magCapacity=20 -- How much a magazine can hold at once
  260. magAmmo=20 -- How much ammo is in the mag
  261. crosshairSpread=5
  262. spread=1
  263. pAmmunition=true -- more damage if true
  264.  
  265.  
  266. jamRate=500 -- How often the gun jams(the more the less) (no less than 1)
  267.  
  268. primaryColor='Really black'
  269. secondaryColor='Really black'
  270.  
  271. slideReflectance=0.01
  272. slideMaterial='Plastic'
  273.  
  274. --[[Attachments]]--
  275.  
  276. silencer=true
  277. highCapMag=false -- High capacity magazine
  278. laser=true
  279. automatic=false
  280. grip=true
  281.  
  282.  
  283. getSound=function(id)
  284. game:service'ContentProvider':Preload('rbxassetid'..tostring(id))
  285. local s=int("Sound",ch.Head)
  286. s.SoundId='rbxassetid://' .. tostring(id)
  287. s.Volume=1
  288. return s
  289. end
  290.  
  291. local fireSound=getSound(151997297--[[10209842]])
  292. fireSound.Pitch=1.3
  293. --1.8
  294.  
  295. local releaseSound=getSound(10209813)
  296. releaseSound.Pitch=4
  297.  
  298. local reloadSound=getSound(10209636)
  299. reloadSound.Pitch=3
  300.  
  301. local magazinelockSound=getSound(152206337)
  302. magazinelockSound.Pitch=1.4
  303.  
  304. local slideBackSound=getSound(152206263)
  305. slideBackSound.Pitch=2.5
  306.  
  307. local slideForwardSound=getSound(152206302)
  308. slideForwardSound.Pitch=2.5
  309.  
  310. local emptySound=getSound(2697295)
  311. emptySound.Pitch=5
  312.  
  313. local glassBreakSound=getSound(144884907)
  314.  
  315. local woodImpact=getSound(142082171)
  316.  
  317. local fleshImpact=getSound(144884872)
  318. fleshImpact.Pitch=1.7
  319.  
  320. if ch:findFirstChild("Tec-99") then
  321. ch['Tec-99']:Destroy()
  322. end
  323.  
  324. local tube=int("Model",ch)
  325. tube.Name='Tec-99'
  326. local hopper=Instance.new('HopperBin',plr.Backpack)
  327. hopper.Name=tube.Name
  328. Weld = function(p0,p1,x,y,z,rx,ry,rz,par)--recommend to use this with my weld. use this function only with arm lockers.
  329. p0.Position = p1.Position
  330. local w = Instance.new('Motor',par or p0)
  331. w.Part0 = p1
  332. w.Part1 = p0
  333. w.C0 = CFrame.new(x or 0,y or 0,z or 0)*CFrame.Angles(rx or 0,ry or 0,rz or 0)
  334. w.MaxVelocity = .1
  335. return w
  336. end
  337. function clerp(c1,c2,sp)
  338. local R1,R2,R3 = c1:toEulerAnglesXYZ()
  339. local R21,R22,R23 = c2:toEulerAnglesXYZ()
  340. return CFrame.new(
  341. c1.X + (c2.X-c1.X)*sp,
  342. c1.Y + (c2.Y-c1.Y)*sp,
  343. c1.Z + (c2.Z-c1.Z)*sp)*CFrame.Angles(
  344. R1 + (R21-R1)*sp,
  345. R2 + (R22-R2)*sp,
  346. R3 + (R23-R3)*sp
  347. )
  348. end
  349.  
  350. tweenTable={}
  351. Tween = function(Weld, Stop, Step,a)
  352. ypcall(function()
  353. local func = function()
  354. local Start = Weld.C1
  355. local X1, Y1, Z1 = Start:toEulerAnglesXYZ()
  356. local Stop = Stop
  357. local X2, Y2, Z2 = Stop:toEulerAnglesXYZ()
  358. if not Step then Step=0.1 end
  359. table.insert(tweenTable,{th=0,Weld=Weld,Step=Step,Start=Start,X1=X1,Y1=Y1,Z1=Z1,Stop=Stop,X2=X2,Y2=Y2,Z2=Z2})
  360. end
  361. if a then coroutine.wrap(func)() else func() end
  362. end)
  363. end
  364. weld=function(p0,p1,c0)
  365. local w=Instance.new("Weld",p0)
  366. w.Part0=p0
  367. w.Part1=p1
  368. w.C0=c0
  369. return w
  370. end
  371. cp=function(parent,color,size,anchored,cancollide)
  372. local newp=Instance.new("Part",parent)
  373. newp.TopSurface='SmoothNoOutlines'
  374. newp.BottomSurface='SmoothNoOutlines'
  375. newp.FrontSurface='SmoothNoOutlines'
  376. newp.BackSurface='SmoothNoOutlines'
  377. newp.RightSurface='SmoothNoOutlines'
  378. newp.LeftSurface='SmoothNoOutlines'
  379. newp.FormFactor="Custom"
  380. newp.BrickColor=bc(color)
  381. newp.Size=size
  382. newp.Anchored=anchored
  383. newp.CanCollide=cancollide
  384. newp:BreakJoints()
  385. return newp
  386. end
  387.  
  388. initializeJoints=function()
  389. rabr = cp(tube,'White',Vector3.new(1,1,1),false,false) rabr.Transparency = 1 rabr.Name='Locker'
  390. rabr.Position = torso.Position
  391. rw = Weld(rabr,torso,1.5,.5,0,0,0,0) rw.Parent = tube rw.Name = 'rw'
  392. w = Instance.new("Weld",tube)
  393. w.Part0,w.Part1 = ch['Right Arm'],rabr
  394. w.C1 = CFrame.new(0,-.5,0)
  395. labr = cp(tube,'White',Vector3.new(1,1,1),false,false) labr.Transparency = 1 labr.Name='Locker'
  396. labr.Position = torso.Position
  397. lw = Weld(labr,torso,-1.5,.5,0,0,0,0) lw.Parent = tube lw.Name = 'lw'
  398. ww = Instance.new("Weld",tube)
  399. ww.Part0,ww.Part1 = ch['Left Arm'],labr
  400. ww.C1 = CFrame.new(0,-.5,0)
  401. end
  402.  
  403. initializeJoints()
  404.  
  405. --[[ leg locks
  406. rabl = cp(tube,'White',Vector3.new(1,1,1),false,false) rabl.Transparency = 1 rabl.Name='Locker'
  407. rabl.Position = torso.Position
  408. rwl = Weld(rabl,torso,0.5,-1.5,0,0,0,0) rwl.Parent = tube rwl.Name = 'rwl'
  409. wl = Instance.new("Weld",tube)
  410. wl.Part0,wl.Part1 = ch['Right Leg'],rabl
  411. wl.C1 = CFrame.new(0,-.5,0)
  412. labl = cp(tube,'White',Vector3.new(1,1,1),false,false) labl.Transparency = 1 labl.Name='Locker'
  413. labl.Position = torso.Position
  414. lwl = Weld(labl,torso,-0.5,-1.5,0,0,0,0) lwl.Parent = tube lwl.Name = 'lwl'
  415. wwl = Instance.new("Weld",tube)
  416. wwl.Part0,wwl.Part1 = ch['Left Leg'],labl
  417. wwl.C1 = CFrame.new(0,-.5,0)
  418. ]]
  419. --weld(ch['HumanoidRootPart'],torso,cfn())
  420.  
  421.  
  422. local counter=Instance.new('ScreenGui',plr.PlayerGui)
  423. local frame=Instance.new('Frame',counter)
  424. frame.Size=UDim2.new(0.25,0,0.3,0)
  425.  
  426. frame.Position=UDim2.new(0.1,0,0.4,0)
  427. frame.BackgroundTransparency=1
  428.  
  429. local ammocounter=Instance.new('TextLabel',frame)
  430. ammocounter.Size=UDim2.new(1,0,0.3,0)
  431. ammocounter.Position=UDim2.new(0,0,0.2,0)
  432. ammocounter.BackgroundTransparency=1
  433. ammocounter.TextColor3=BrickColor.new('White').Color
  434. ammocounter.Font='SourceSansBold'
  435. ammocounter.FontSize='Size18'
  436. ammocounter.Text=''
  437. ammocounter.TextXAlignment='Left'
  438.  
  439.  
  440. local bg = Instance.new("BodyGyro",rootpart)
  441. bg.maxTorque = Vector3.new(math.huge,math.huge,math.huge)
  442. bg.P = 10000
  443. bg.D = 100
  444.  
  445.  
  446. cyl=function(prt)
  447. local c=int("CylinderMesh",prt)
  448. return c
  449. end
  450. blo=function(prt)
  451. local c=int("BlockMesh",prt)
  452. return c
  453. end
  454.  
  455. if laser then
  456. aLaser=cp(tube,'Really red',Vector3.new(0.2,0.2,0.2))
  457. aLaser.Transparency=1
  458. cyl(aLaser).Scale=Vector3.new(0.25,1,0.25)
  459. aLaser.Anchored=true
  460. end
  461.  
  462. local handle=cp(tube,primaryColor,Vector3.new(0.2,0.6,0.3))
  463. blo(handle).Scale=Vector3.new(1.15,0.9,1)
  464. local mw=weld(ch['Right Arm'],handle,cfn(-0.4,-1,-0.19)*ang(mr(-101.5),0,0)*cfn()*ang(0,mr(-30),mr(-5)))
  465.  
  466. local framepiece1=cp(tube,primaryColor,Vector3.new(0.2,0.2,0.9))
  467. blo(framepiece1).Scale=Vector3.new(1.15,0.5,1)
  468. weld(handle,framepiece1,cfn(0,0.354,-0.3)*ang(mr(11.5),0,0))
  469.  
  470. local barrel=cp(tube,'Medium stone grey',Vector3.new(0.2,0.2,0.2))
  471. cyl(barrel).Scale=Vector3.new(0.7,1.2,0.7)
  472. weld(framepiece1,barrel,cfn(0,0.15,-0.1)*ang(mr(-90),0,0))
  473.  
  474. local sbarrel=cp(tube,'Really black',Vector3.new(0.2,0.3,0.2))
  475. cyl(sbarrel).Scale=Vector3.new(0.7,1.5,0.7)
  476. weld(barrel,sbarrel,cfn(0,0.35,0))
  477. local hole=cp(tube,'White',Vector3.new(0.2,0.2,0.2))
  478. hole.Transparency=1
  479. weld(sbarrel,hole,cfn(0,0.2,0))
  480. local flash=int('PointLight',hole)
  481. flash.Enabled=false
  482. flash.Range=10
  483. flash.Color=BrickColor.new('Neon orange').Color
  484.  
  485.  
  486. local slide1=cp(tube,secondaryColor,Vector3.new(0.2,0.2,0.4))
  487. slide1.CanCollide=false
  488. blo(slide1).Scale=Vector3.new(0.7,1,1.1)
  489. slideweld1=weld(framepiece1,slide1,cfn(0,0.15,0.23))
  490. slide1.Reflectance=slideReflectance
  491. slide1.Material=slideMaterial
  492.  
  493. local slide2=cp(tube,secondaryColor,Vector3.new(0.2,0.2,0.4))
  494. slide2.CanCollide=false
  495. blo(slide2).Scale=Vector3.new(0.7,1,1.1)
  496. slideweld2=weld(slide1,slide2,cfn(0,0,-0.666))
  497. slide2.Reflectance=slideReflectance
  498. slide2.Material=slideMaterial
  499.  
  500. local slideside1=cp(tube,secondaryColor,Vector3.new(0.2,0.2,1.1))
  501. slideside1.CanCollide=true
  502. blo(slideside1).Scale=Vector3.new(0.25,1,1)
  503. weld(slide1,slideside1,cfn(-0.09,0,-0.335))
  504. slideside1.Reflectance=slideReflectance
  505. slideside1.Material=slideMaterial
  506.  
  507. local slideside2=cp(tube,secondaryColor, Vector3.new(0.2,0.2,0.4))
  508. slideside2.CanCollide=true
  509. blo(slideside2).Scale=Vector3.new(0.25,1,1.1)
  510. weld(slide1,slideside2,cfn(0.09,0,0))
  511. slideside2.Reflectance=slideReflectance
  512. slideside2.Material=slideMaterial
  513.  
  514. local slideside3=cp(tube,secondaryColor, Vector3.new(0.2,0.2,0.3))
  515. slideside3.CanCollide=true
  516. blo(slideside3).Scale=Vector3.new(0.25,0.6,0.78)
  517. weld(slideside2,slideside3,cfn(0,-0.04,-0.335))
  518. slideside3.Reflectance=slideReflectance
  519. slideside3.Material=slideMaterial
  520.  
  521. local slideside4=cp(tube,secondaryColor, Vector3.new(0.2,0.2,0.4))
  522. blo(slideside4).Scale=Vector3.new(0.25,1,1.1)
  523. weld(slide2,slideside4,cfn(0.09,0,0))
  524. slideside4.Reflectance=slideReflectance
  525. slideside4.Material=slideMaterial
  526.  
  527. local mgs=cp(tube,primaryColor,Vector3.new(0.2,0.2,0.2))
  528. blo(mgs).Scale=Vector3.new(1.15,0.425,0.245)
  529. weld(handle,mgs,cfn(0,-0.3,0.125))
  530.  
  531. --[[Trigger]]--
  532. local tp1=cp(tube,primaryColor,Vector3.new(0.2,0.2,0.2))
  533. blo(tp1).Scale=Vector3.new(0.6,0.1,0.8)
  534. weld(framepiece1,tp1,cfn(0,-0.22,0.13))
  535.  
  536. local tp2=cp(tube,primaryColor,Vector3.new(0.2,0.2,0.2))
  537. blo(tp2).Scale=Vector3.new(0.6,0.1,1.19)
  538. weld(framepiece1,tp2,cfn(0,-0.14,-0.0265)*ang(mr(45),0,0))
  539.  
  540. local trigger1=cp(tube,'Really black',Vector3.new(0.2,0.2,0.2))
  541. blo(trigger1).Scale=Vector3.new(0.3,0.4,0.16)
  542. weld(framepiece1,trigger1,cfn(0,-0.07,0.09))
  543.  
  544. local trigger2=cp(tube,'Really black',Vector3.new(0.2,0.2,0.2))
  545. blo(trigger2).Scale=Vector3.new(0.3,0.3,0.16)
  546. weld(trigger1,trigger2,cfn(0,-0.06,-0.015)*ang(mr(30),0,0))
  547.  
  548.  
  549. --[[Magazine]]--
  550.  
  551. local magh=cp(tube,'Really black',Vector3.new(0.2,0.5,0.2))
  552. blo(magh).Scale=Vector3.new(0.6,1,1)
  553. local magweld=weld(handle,magh,cfn(0,-0.025,0))
  554.  
  555. local bottom=cp(tube,'Really black',Vector3.new(0.2,0.2,0.3))
  556. blo(bottom).Scale=Vector3.new(1.15,0.385,0.8)
  557. bottomweld=weld(magh,bottom,cfn(0,-0.28,-0.015))
  558.  
  559. if highCapMag then
  560. magweld:Destroy()
  561. magh.Size=Vector3.new(0.2,0.7,0.2)
  562. magweld=weld(handle,magh,cfn(0,-0.125,0))
  563. bottomweld:Destroy()
  564. bottomweld=weld(magh,bottom,cfn(0,-0.38,-0.015))
  565. magCapacity=magCapacity+23
  566. magAmmo=magAmmo+23
  567. end
  568.  
  569. --[[Sights]]--
  570. local backsight1=cp(tube,'Black',Vector3.new(0.2,0.2,0.2))
  571. blo(backsight1).Scale=Vector3.new(0.3,0.3,0.3)
  572. weld(slide1,backsight1,cfn(0.06,0.1,0.13))
  573. local backsight2=cp(tube,'Black',Vector3.new(0.2,0.2,0.2))
  574. blo(backsight2).Scale=Vector3.new(0.3,0.3,0.3)
  575. weld(slide1,backsight2,cfn(-0.06,0.1,0.13))
  576.  
  577. local frontsight=cp(tube,'Black',Vector3.new(0.2,0.2,0.2))
  578. blo(frontsight).Scale=Vector3.new(0.3,0.3,0.3)
  579. weld(slide1,frontsight,cfn(0,0.1,-0.85))
  580.  
  581. local dot1=cp(tube,'Lime green',Vector3.new(0.2,0.2,0.2))
  582. cyl(dot1).Scale=Vector3.new(0.1,0.31,0.1)
  583. weld(backsight1,dot1,cfn(0,0.014,0)*ang(mr(-90),0,0))
  584.  
  585. local dot2=cp(tube,'Lime green',Vector3.new(0.2,0.2,0.2))
  586. cyl(dot2).Scale=Vector3.new(0.1,0.31,0.1)
  587. weld(backsight2,dot2,cfn(0,0.014,0)*ang(mr(-90),0,0))
  588.  
  589. local dot3=cp(tube,'Lime green',Vector3.new(0.2,0.2,0.2))
  590. cyl(dot3).Scale=Vector3.new(0.1,0.31,0.1)
  591. weld(frontsight,dot3,cfn(0,0.014,0)*ang(mr(-90),0,0))
  592.  
  593. local ba=cp(tube,secondaryColor,Vector3.new(0.2,0.2,0.2))
  594. blo(ba).Scale=Vector3.new(1.15,0.5,1)
  595. weld(framepiece1,ba,cfn(0,0,-0.55))
  596. ba.Reflectance=slideReflectance
  597. ba.Material=slideMaterial
  598.  
  599. local weirdholethatpistolshave=cp(tube,'Really black', Vector3.new(0.2,0.2,0.2))
  600. cyl(weirdholethatpistolshave).Scale=Vector3.new(0.4,1.01,0.4)
  601. weld(ba,weirdholethatpistolshave,cfn(0,0,0)*ang(mr(-90),0,0))
  602.  
  603. --[[Tactical Rails]]--
  604.  
  605. local r1=cp(tube,primaryColor,Vector3.new(0.2,0.2,0.2))
  606. blo(r1).Scale=Vector3.new(1.15,0.2,0.25)
  607. weld(framepiece1,r1,cfn(0,-0.05,-0.17))
  608.  
  609. local r2=cp(tube,primaryColor,Vector3.new(0.2,0.2,0.2))
  610. blo(r2).Scale=Vector3.new(1.15,0.2,0.25)
  611. weld(framepiece1,r2,cfn(0,-0.05,-0.27))
  612.  
  613. local r3=cp(tube,primaryColor,Vector3.new(0.2,0.2,0.2))
  614. blo(r3).Scale=Vector3.new(1.15,0.2,0.25)
  615. weld(framepiece1,r3,cfn(0,-0.05,-0.37))
  616.  
  617. if laser then
  618. local base=cp(tube,primaryColor,Vector3.new(0.2,0.2,0.3))
  619. blo(base).Scale=Vector3.new(1.15,1,1)
  620. weld(r2,base,cfn(0,-0.05,0))
  621. basehole=cp(tube,'White',Vector3.new(0.2,0.2,0.2))
  622. cyl(basehole).Scale=Vector3.new(0.4,0.4,0.4)
  623. weld(base,basehole,cfn(0,0,-0.13)*ang(mr(-90),0,0))
  624. end
  625.  
  626. if silencer then
  627. local sil=cp(tube,'Really black',Vector3.new(0.2,0.3,0.2))
  628. fireSound.SoundId='rbxassetid://153230595'
  629. fireSound.Pitch=1
  630. cyl(sil).Scale=Vector3.new(0.94,1.8,0.94)
  631. weld(hole,sil,cfn(0,0.29,0))
  632. end
  633.  
  634. if grip then
  635. local base=cp(tube,primaryColor,Vector3.new(0.2,0.2,0.3))
  636. blo(base).Scale=Vector3.new(1.15,1,1)
  637. weld(r2,base,cfn(0,-0.05,0))
  638. local hd=cp(tube,primaryColor,Vector3.new(0.2,0.6,0.2))
  639. cyl(hd)
  640. weld(base,hd,cfn(0,-0.3,0))
  641. crosshairSpread=3
  642. spreadint=spreadint-0.3
  643. end
  644.  
  645. --[[Test Functions]]--
  646.  
  647. local debounce=false
  648. local out=false
  649. local bs=false
  650. cockSlide=function() -- hahaha yes i know
  651. slideBackSound:Play()
  652. if magAmmo<1 and out==true and bs==false then
  653. wait()
  654. slideweld1.C0=slideweld1.C0*cfn(0,0,0.22)
  655. else
  656. for i=1,2 do
  657. wait()
  658. slideweld1.C0=slideweld1.C0*cfn(0,0,0.22)
  659. end
  660. end
  661. local ajar=false
  662. if magAmmo==1 then
  663. ajar=true
  664. end
  665. if magAmmo>0 then
  666. createShell()
  667. --magAmmo=magAmmo-1
  668. ammocounter.Text=''
  669. for i=1,magAmmo do
  670. ammocounter.Text=ammocounter.Text .. 'I'
  671. end
  672. end
  673. wait(0.15)
  674. slideForwardSound:Play()
  675. for i=1,2 do
  676. wait()
  677. slideweld1.C0=slideweld1.C0*cfn(0,0,-0.22)
  678. end
  679. if ajar==true then
  680. out=true
  681. slideweld1.C0=cfn(0,0.15,0.23)
  682. slideweld1.C0=slideweld1.C0*cfn(0,0,0.22)
  683. end
  684. end
  685.  
  686. --fx
  687. local firefx=cp(tube,'Neon orange',Vector3.new(0.7,1.1,0.7))
  688. firefx.Transparency=1
  689. local mesh=Instance.new('SpecialMesh',firefx)
  690. mesh.MeshType='Sphere'
  691. firefx.Material='Neon'
  692. weld(hole,firefx,cfn(0,1,0))
  693.  
  694. local smokefx=Instance.new('Smoke',hole)
  695. smokefx.Enabled=false
  696. barrel.CanCollide=true
  697.  
  698.  
  699.  
  700.  
  701. local oc = oc or function(...) return ... end
  702.  
  703. function ragJoint(hit,r,d)
  704. Spawn(oc(function()
  705. d = d or 0
  706. local rpar,r0,r1 = r.Parent,r.Part0,r.Part1
  707. if d > 0 then wait(d) end
  708. local p = hit:Clone()
  709. p:BreakJoints()
  710. p:ClearAllChildren()
  711. p.FormFactor = "Custom"
  712. p.Size = p.Size/2
  713. p.Transparency = 1
  714. p.CanCollide = true
  715. p.Name = "Colliduh"
  716. p.Parent = hit
  717. local w = Instance.new("Weld",p)
  718. w.Part0 = hit
  719. w.Part1 = p
  720. w.C0 = CFrame.new(0,-p.Size.Y/2,0)
  721. local rot = Instance.new("Rotate",rpar)
  722. rot.Name = r.Name
  723. rot.Part0 = r0
  724. rot.Part1 = r1
  725. rot.C0 = r.C0
  726. rot.C1 = r.C1
  727. r0.Velocity = Vector3.new()
  728. r1.Velocity = Vector3.new()
  729. r:Destroy()
  730. end))
  731. end
  732.  
  733.  
  734. createShell=function()
  735. local shell=cp(tube,'Deep orange',Vector3.new(0.2,0.3,0.2))
  736. shell.CanCollide=true
  737. shell.Reflectance=0.3
  738. cyl(shell)
  739. shell.CFrame=barrel.CFrame*ang(mr(-90),0,0)
  740. magAmmo=magAmmo-1
  741. ammocounter.Text=''
  742. for i=1,magAmmo do
  743. ammocounter.Text=ammocounter.Text .. 'I'
  744. end
  745. game.Debris:AddItem(shell,3)
  746. end
  747.  
  748. reloadPistol=function()
  749. local current=magAmmo
  750. Tween(lw,cfn())
  751. Tween(rw,cfn()*ang(mr(-102),0,0))
  752. wait(0.4)
  753. releaseSound:Play()
  754. bottom.Transparency=1
  755. magh.Transparency=1
  756. local mag1=magh:clone()
  757. mag1.Transparency=0
  758. mag1.Weld:Destroy''
  759. local mag2=bottom:clone()
  760. mag2.Transparency=0
  761. mag1:BreakJoints''
  762. mag2:BreakJoints''
  763. local bm1=mag1:clone()
  764. local bm2=mag2:clone()
  765. mag1.Parent=tube
  766. mag2.Parent=tube
  767. mag1.CFrame=magh.CFrame
  768. weld(mag1,mag2,cfn(0,-0.28,-0.015))
  769. magAmmo=0
  770. ammocounter.Text=''
  771. for i=1,magAmmo do
  772. ammocounter.Text=ammocounter.Text .. 'I'
  773. end
  774. wait()
  775. mag1.CanCollide=true
  776. mag2.CanCollide=true
  777. game.Debris:AddItem(mag1,2)
  778. game.Debris:AddItem(mag2,2)
  779. wait(0.1)
  780. Tween(lw,cfn()*ang(mr(25),0,0))
  781. bm1.Parent=tube
  782. bm2.Parent=tube
  783. weld(bm1,bm2,cfn(0,-0.28,-0.015))
  784. local fa=weld(ch['Left Arm'],bm1,cfn(0,-1.1,0)*ang(mr(-90),0,0))
  785. wait(0.1)
  786. Tween(lw,cfn(0,1.4,0)*ang(mr(-109),mr(60),mr(10)),0.07)
  787. wait(0.25)
  788. magazinelockSound:Play()
  789. wait()
  790. -- reloadSound:Play()
  791. fa:Destroy''
  792. bm1:Destroy''
  793. bm2:Destroy''
  794. bottom.Transparency=0
  795. magh.Transparency=0
  796. local totalcap=0
  797. if current<1 then --none in chamber reload
  798. --slideweld1.C0=cfn(0,0,0.45)
  799. Tween(rw,cfn(0,0.7,0)*ang(mr(-90),mr(-30),0))
  800. Tween(lw,cfn(0,0.7,0)*ang(mr(-115),mr(35),0))
  801. wait(0.1)
  802. spawn(function()
  803. cockSlide()
  804. end)
  805. Tween(lw,cfn(0,0.7,0)*ang(mr(-115),mr(55),0))
  806. wait(0.3)
  807. totalcap=magCapacity
  808. else
  809. totalcap=magCapacity+1
  810. end
  811. magAmmo=totalcap
  812. out=false
  813. ammocounter.Text=''
  814. for i=1,magAmmo do
  815. ammocounter.Text=ammocounter.Text .. 'I'
  816. end
  817. restorePosition()
  818. end
  819.  
  820. firePistol=function()
  821. switchIco(currentIco+crosshairSpread)
  822. if not jammed and not out then
  823. spread=spread+spreadint
  824. end
  825. print(spread)
  826. fireSound.Pitch=math.random(math.random(fireSound.Pitch-0.2,fireSound.Pitch-0.1),math.random(fireSound.Pitch,fireSound.Pitch+0.1))
  827. if magAmmo>0 and jammed==false then
  828. local ajar=false
  829. if magAmmo==1 then
  830. ajar=true
  831. end
  832. user=ch
  833. local ray = Ray.new(hole.CFrame.p, ((m.Hit.p+Vector3.new(math.random(-spread,spread)/6.35,math.random(-spread,spread)/6.35,math.random(-spread,spread)/6.35) )- hole.CFrame.p).unit*300)
  834. local hit, position = game.Workspace:FindPartOnRay(ray, user)
  835. if hit then
  836. if hit.Transparency>0.285 and hit:GetMass()<3000 and hit.Parent.className~='Hat' then
  837. local temps=glassBreakSound:clone()
  838. temps.Parent=hit
  839. temps.Pitch=math.random(math.random(temps.Pitch-0.2,temps.Pitch-0.1),math.random(temps.Pitch,temps.Pitch+0.1))
  840. temps:Play''
  841. start_fragmentation(position,.25)
  842. end
  843. if tostring(hit.Material)=='Enum.Material.Wood' and hit.Transparency<0.05 then
  844. local temps=woodImpact:clone()
  845. temps.Volume=1
  846. temps.Pitch=math.random(math.random(temps.Pitch-0.2,temps.Pitch-0.1),math.random(temps.Pitch,temps.Pitch+0.1))
  847. temps.Parent=hit
  848. temps:Play''
  849. start_fragmentation(position,.15)
  850. end
  851. ypcall(function()
  852. if hit and hit.Parent and hit.Parent:findFirstChild'Humanoid' then
  853. local temps=fleshImpact:clone()
  854. temps.Parent=hit
  855. temps:Play()
  856. if hit.Name~='Head' then
  857. if pAmmunition==true then
  858. hit.Parent.Humanoid:TakeDamage(math.random(30,65))
  859. else
  860. hit.Parent.Humanoid:TakeDamage(math.random(10,24))
  861. end
  862. local guy=hit.Parent
  863. if guy.Name~='TheDarkRevenant' then
  864. for i,v in pairs(guy:GetChildren()) do
  865. if v.className=='Hat' then
  866. v.Handle:BreakJoints()
  867. end
  868. local r = guy.Torso:FindFirstChild(v.Name:gsub("Arm","Shoulder"):gsub("Leg","Hip"))
  869. if v:IsA("BasePart") and r then
  870. ragJoint(v,r,.1)
  871. elseif v:IsA("Humanoid") then
  872. spawn(function()
  873. wait(0.5)
  874. v.PlatformStand = true
  875. v.Changed:connect(function()
  876. v.PlatformStand = true
  877. end)
  878. end)
  879. end
  880. end
  881. end
  882.  
  883. else
  884. if hit.Parent.Name~='TheDarkRevenant' then
  885. hit.Parent:BreakJoints()
  886. end
  887. end
  888. end
  889.  
  890. if hit.Parent.className=='Hat' then
  891. hit.CanCollide=true
  892. hit:BreakJoints()
  893. hit.Velocity=m.Hit.p*5
  894. end
  895. end)
  896. end
  897. if m.Target then
  898. local p = Instance.new("Part")
  899. p.formFactor = "Custom"
  900. p.Size = Vector3.new(0.5,0.5,0.5)
  901. p.Transparency = 1
  902. p.CanCollide = false
  903. p.Locked = true
  904. p.CFrame = CFrame.new(position.x,position.y,position.z)--mouse.Target.CFrame+(mouse.Hit.p-mouse.Target.Position)
  905. local w = Instance.new("Weld")
  906. w.Part0 = mouse.Target
  907. w.Part1 = p
  908. w.C0 = mouse.Target.CFrame:inverse()
  909. w.C1 = p.CFrame:inverse()
  910. w.Parent = p
  911. local d = Instance.new("Decal")
  912. d.Parent = p
  913. d.Face = mouse.TargetSurface
  914. d.Texture = 'rbxassetid://' .. tostring(bulletholes[math.random(#bulletholes)]-2)
  915. p.Parent = tube
  916. game.Debris:AddItem(p,6)
  917. end
  918. if recoil==true then
  919. cam:SetRoll(math.random(-2,2))
  920. cam:TiltUnits(0.501)
  921. end
  922. local th=cp(tube,"Really black",Vector3.new(1,1,1))
  923. th.CanCollide=false
  924. th.Anchored=true
  925. th.CFrame=CFrame.new(position.x,position.y,position.z)
  926. local spm=Instance.new('SpecialMesh',th)
  927. spm.MeshType='Sphere'
  928. spm.Scale=Vector3.new(0.05,0.05,0.05)
  929. spawn(function()
  930. for i=1,5 do
  931. wait()
  932. spm.Scale=spm.Scale+Vector3.new(0.16,0.16,0.16)
  933. th.Transparency=th.Transparency+0.2
  934. end
  935. th:Destroy()
  936. end)
  937. fireSound:Play()
  938. spawn(function()
  939. firefx.Transparency=0
  940. wait()
  941. firefx.Transparency=1
  942. end)
  943. spawn(function()
  944. flash.Enabled=true
  945. for i=1,2 do
  946. wait()
  947. slideweld1.C0=slideweld1.C0*cfn(0,0,0.22)
  948. end
  949. flash.Enabled=false
  950. createShell()
  951. for i=1,2 do
  952. wait()
  953. slideweld1.C0=slideweld1.C0*cfn(0,0,-0.22)
  954. end
  955. slideweld1.C0=cfn(0,0.15,0.23)
  956. if ajar==true then
  957. out=true
  958. slideweld1.C0=cfn(0,0.15,0.23)
  959. slideweld1.C0=slideweld1.C0*cfn(0,0,0.22)
  960. end
  961. end)
  962. ammocounter.Text=''
  963. for i=1,magAmmo do
  964. ammocounter.Text=ammocounter.Text .. 'I'
  965. end
  966. wait()
  967. Tween(rw,cfn(0,0.7,0)*ang(mr(-100),mr(-30),0),0.62)
  968. if not grip then
  969. Tween(lw,cfn(0,0.7,0)*ang(mr(-100),mr(30),0),0.62)
  970. else
  971. Tween(lw,cfn(0,1.3,0)*ang(mr(-100),mr(30),0),0.62)
  972. end
  973. wait(0.065)
  974. restorePosition(0.3)
  975. else
  976. if magAmmo<1 then
  977. slideweld1.C0=cfn(0,0.15,0.23)
  978. slideweld1.C0=slideweld1.C0*cfn(0,0,0.22)
  979. end
  980. emptySound:Play()
  981. end
  982. if math.random(jamRate)==jamRate and magAmmo>0 then
  983. jammed=true
  984. end
  985. end
  986.  
  987. debounced=function()
  988. if sheathed==false and debounce==false then
  989. return true
  990. end
  991. end
  992.  
  993. mouse.Button1Down:connect(function()
  994. if debounced() then
  995. if automatic==false then
  996. debounce=true
  997. firePistol()
  998. debounce=false
  999. else
  1000. heldDown=true
  1001. firePistol()
  1002. end
  1003. end
  1004. end)
  1005.  
  1006. mouse.Button1Up:connect(function()
  1007. heldDown=false
  1008. end)
  1009.  
  1010. sheathGun=function()
  1011. ammocounter.Visible=false
  1012. if laser then
  1013. laserEnabled=false
  1014. aLaser.Transparency=1
  1015. end
  1016. Tween(rw,cfn())
  1017. Tween(lw,cfn())
  1018. wait(0.1)
  1019. mw:Destroy''
  1020. mw=nil
  1021. mw=weld(tor,handle,cfn(1.11,-1.09,0)*ang(mr(-111.5),0,0))
  1022. labr:Destroy()
  1023. rabr:Destroy()
  1024. bg.maxTorque=Vector3.new()
  1025. sheathed=true
  1026. end
  1027.  
  1028. unsheathGun=function()
  1029. ammocounter.Visible=true
  1030. mw:Destroy''
  1031. mw=nil
  1032. initializeJoints()
  1033. mw=weld(ch['Right Arm'],handle,cfn(-0.4,-1,-0.19)*ang(mr(-101.5),0,0)*cfn()*ang(0,mr(-30),mr(-5)))
  1034. restorePosition()
  1035. bg.maxTorque = Vector3.new(math.huge,math.huge,math.huge)
  1036. sheathed=false
  1037. end
  1038.  
  1039. laserEnabled=false
  1040.  
  1041. mouse.KeyDown:connect(function(key)
  1042. if key=='r' and debounced() then
  1043. debounce=true
  1044. reloadPistol()
  1045. debounce=false
  1046. elseif key=='f' and debounced() then
  1047. debounce=true
  1048. bs=true
  1049. Tween(rw,cfn(0,0.7,0)*ang(mr(-90),mr(-30),0))
  1050. Tween(lw,cfn(0,0.7,0)*ang(mr(-115),mr(35),0))
  1051. wait(0.1)
  1052. spawn(function()
  1053. cockSlide()
  1054. end)
  1055. Tween(lw,cfn(0,0.7,0)*ang(mr(-115),mr(55),0))
  1056. wait(0.3)
  1057. jammed=false
  1058. restorePosition()
  1059. bs=false
  1060. debounce=false
  1061. elseif key=='l' and debounced() then
  1062. if not laserEnabled then
  1063. laserEnabled=true
  1064. aLaser.Transparency=0.35
  1065. else
  1066. laserEnabled=false
  1067. aLaser.Transparency=1
  1068. end
  1069. end
  1070. end)
  1071.  
  1072. restorePosition=function(speed)
  1073. if not grip then
  1074. Tween(rw,cfn(0,0.7,0)*ang(mr(-90),mr(-30),0),speed)
  1075. Tween(lw,cfn(0,0.7,0)*ang(mr(-90),mr(30),0),speed)
  1076. else
  1077. Tween(rw,cfn(0,0.7,0)*ang(mr(-90),mr(-30),0),speed)
  1078. Tween(lw,cfn(0,1.3,0)*ang(mr(-90),mr(30),0),speed)
  1079. end
  1080. end
  1081.  
  1082. hopper.Selected:connect(function()
  1083. unsheathGun()
  1084. end)
  1085.  
  1086. hopper.Deselected:connect(function()
  1087. sheathGun()
  1088. end)
  1089.  
  1090. game:service'RunService'.RenderStepped:connect(function()
  1091. bg.cframe = CFrame.new(rootpart.Position,mouse.Hit.p*Vector3.new(1,0,1)+rootpart.Position*Vector3.new(0,1,0))
  1092. if laserEnabled==true then
  1093. local user=ch
  1094. local ray = Ray.new(hole.CFrame.p, (m.Hit.p - hole.CFrame.p).unit*300)
  1095. local hit, position = game.Workspace:FindPartOnRay(ray, user)
  1096. local distance = (position - basehole.CFrame.p).magnitude
  1097. aLaser.Size=Vector3.new(0.2,distance,0.2)
  1098. aLaser.CFrame=CFrame.new(position, basehole.CFrame.p) * CFrame.new(0, 0, -distance/2) * ang(mr(-90),0,0)
  1099. end
  1100. for _,v in pairs(tweenTable) do
  1101. if v.Weld.C1==v.Stop then
  1102. table.remove(tweenTable,_)
  1103. else
  1104. if v.th<0.9 then
  1105. v.th=v.th+v.Step
  1106. i=v.th
  1107. v.Weld.C1 = CFrame.new( (v.Start.p.X * (1 - i)) + (v.Stop.p.X * i),
  1108. (v.Start.p.Y * (1 - i)) + (v.Stop.p.Y * i),
  1109. (v.Start.p.Z * (1 - i)) + (v.Stop.p.Z * i)) * CFrame.fromEulerAnglesXYZ(
  1110. (v.X1 * (1 - i)) + (v.X2 * i), (v.Y1 * (1 - i)) + (v.Y2 * i),
  1111. (v.Z1 * (1 - i)) + (v.Z2 * i) )
  1112. else
  1113. v.Weld.C1 = v.Stop
  1114. end
  1115. end
  1116. end
  1117. end)
  1118. for i=1,magAmmo do
  1119. ammocounter.Text=ammocounter.Text .. 'I'
  1120. end
  1121.  
  1122. sheathGun()
  1123.  
  1124. spawn(function()
  1125. while wait(0.07) do
  1126. if heldDown==true then
  1127. spawn(function()
  1128. firePistol()
  1129. end)
  1130. end
  1131. end
  1132. end)
  1133. m.TargetFilter=tube
  1134.  
  1135. while wait(0.03) do
  1136. if spread>1 then
  1137. spread=spread-spreadint/4
  1138. end
  1139. if spread<1 then
  1140. spread=1
  1141. end
  1142. if currentIco>2 then
  1143. switchIco(currentIco-1)
  1144. end
  1145. end
  1146.  
  1147. --hl/https://httpget-inumeration.c9.io/mp45.lua
  1148. --local/game.Players.Conmiro:Destroy''
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement