Advertisement
ghostteen14

Untitled

Apr 17th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 33.25 KB | None | 0 0
  1. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  2. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  3. do
  4. print("FE Compatibility code by Mokiros")
  5. script.Parent = Player.Character
  6.  
  7. --RemoteEvent for communicating
  8. local Event = Instance.new("RemoteEvent")
  9. Event.Name = "UserInput_Event"
  10.  
  11. --Fake event to make stuff like Mouse.KeyDown work
  12. local function fakeEvent()
  13. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  14. t.connect = t.Connect
  15. return t
  16. end
  17.  
  18. --Creating fake input objects with fake variables
  19. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  20. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  21. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  22. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  23. end}
  24. --Merged 2 functions into one by checking amount of arguments
  25. CAS.UnbindAction = CAS.BindAction
  26.  
  27. --This function will trigger the events that have been :Connect()'ed
  28. local function te(self,ev,...)
  29. local t = m[ev]
  30. if t and t._fakeEvent and t.Function then
  31. t.Function(...)
  32. end
  33. end
  34. m.TrigEvent = te
  35. UIS.TrigEvent = te
  36.  
  37. Event.OnServerEvent:Connect(function(plr,io)
  38. if plr~=Player then return end
  39. if io.isMouse then
  40. m.Target = io.Target
  41. m.Hit = io.Hit
  42. else
  43. local b = io.UserInputState == Enum.UserInputState.Begin
  44. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  45. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  46. end
  47. for _,t in pairs(CAS.Actions) do
  48. for _,k in pairs(t.Keys) do
  49. if k==io.KeyCode then
  50. t.Function(t.Name,io.UserInputState,io)
  51. end
  52. end
  53. end
  54. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  55. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  56. end
  57. end)
  58. Event.Parent = NLS([==[
  59. local Player = game:GetService("Players").LocalPlayer
  60. local Event = script:WaitForChild("UserInput_Event")
  61.  
  62. local UIS = game:GetService("UserInputService")
  63. local input = function(io,a)
  64. if a then return end
  65. --Since InputObject is a client-side instance, we create and pass table instead
  66. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  67. end
  68. UIS.InputBegan:Connect(input)
  69. UIS.InputEnded:Connect(input)
  70.  
  71. local Mouse = Player:GetMouse()
  72. local h,t
  73. --Give the server mouse data 30 times every second, but only if the values changed
  74. --If player is not moving their mouse, client won't fire events
  75. while wait(1/30) do
  76. if h~=Mouse.Hit or t~=Mouse.Target then
  77. h,t=Mouse.Hit,Mouse.Target
  78. Event:FireServer({isMouse=true,Target=t,Hit=h})
  79. end
  80. end]==],Player.Character)
  81. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  82. end
  83. function clerp(c1,c2,al)
  84. local com1 = {c1.X,c1.Y,c1.Z,c1:toEulerAnglesXYZ()}
  85. local com2 = {c2.X,c2.Y,c2.Z,c2:toEulerAnglesXYZ()}
  86. for i,v in pairs(com1) do
  87. com1[i] = v+(com2[i]-v)*al
  88. end
  89. return CFrame.new(com1[1],com1[2],com1[3]) * CFrame.Angles(select(4,unpack(com1)))
  90. end
  91.  
  92. plr = game:service'Players'.LocalPlayer
  93. plrgui = plr:findFirstChild'PlayerGui'
  94. plrmouse = plr:GetMouse()
  95. char = plr.Character
  96. humanoid = char:findFirstChild("Humanoid")
  97. torso = char:findFirstChild("Torso")
  98. head = char.Head
  99. ra = char:findFirstChild("Right Arm")
  100. la = char:findFirstChild("Left Arm")
  101. rl = char:findFirstChild("Right Leg")
  102. ll = char:findFirstChild("Left Leg")
  103. rs = torso:findFirstChild("Right Shoulder")
  104. ls = torso:findFirstChild("Left Shoulder")
  105. rh = torso:findFirstChild("Right Hip")
  106. lh = torso:findFirstChild("Left Hip")
  107. neck = torso:findFirstChild("Neck")
  108. rj = char:findFirstChild("HumanoidRootPart"):findFirstChild("RootJoint")
  109. rootpart = char:findFirstChild("HumanoidRootPart")
  110. camera = workspace.CurrentCamera
  111. anim = char:findFirstChild("Animate")
  112.  
  113. local rm = Instance.new("Weld")
  114. rm.C0 = CFrame.new(1.5, 0.5, 0)
  115. rm.C1 = CFrame.new(0, 0.5, 0)
  116. rm.Part0 = torso
  117. rm.Part1 = ra
  118. rm.Name = 'Right Shoulder'
  119.  
  120. local lm = Instance.new("Weld")
  121. lm.C0 = CFrame.new(-1.5, 0.5, 0)
  122. lm.C1 = CFrame.new(0, 0.5, 0)
  123. lm.Part0 = torso
  124. lm.Part1 = la
  125. lm.Name = 'Left Shoulder'
  126.  
  127. local tool = Instance.new('HopperBin', plr.Backpack)
  128. tool.Name = 'Dual M1911'
  129.  
  130. function scan(parent)
  131. local parts,last = {}
  132. for _,v in pairs(parent:GetChildren()) do
  133. if (v:IsA("BasePart")) then
  134. v.Anchored = true
  135. if (last) then
  136. local w = Instance.new("Weld")
  137. w.Name = ("%s_Weld"):format(v.Name)
  138. w.Part0,w.Part1 = last,v
  139. w.C0 = last.CFrame:inverse()
  140. w.C1 = v.CFrame:inverse()
  141. w.Parent = last
  142. end
  143. last = v
  144. table.insert(parts,v)
  145. end
  146. scan(v)
  147. end
  148. for _,v in pairs(parts) do
  149. v.Anchored = false
  150. v.Locked = true
  151. v.CanCollide = false
  152. end
  153. end
  154.  
  155. --1-Torso
  156. holsters=Instance.new("Model")
  157. holsters.Name="Torso"
  158. holsters.Parent=char
  159. --2-HolsterWeldTo2
  160. obj2=Instance.new("Part")
  161. obj2.CFrame=CFrame.new(Vector3.new(14.8519955,1.44200003,35.6479988)) * CFrame.Angles(1.8325955867767,-1.4901161193848e-008,-3.1415927410126)
  162. obj2.FormFactor=Enum.FormFactor.Custom
  163. obj2.LeftSurface=10
  164. obj2.Transparency=1
  165. obj2.TopSurface=10
  166. obj2.RightSurface=10
  167. obj2.Material="SmoothPlastic"
  168. obj2.Size=Vector3.new(0.200000003,0.200000003,1.60000014)
  169. obj2.FrontSurface=10
  170. obj2.BottomSurface=10
  171. obj2.BackSurface=10
  172. obj2.BrickColor=BrickColor.new("Dark stone grey")
  173. obj2.Name="HolsterWeldTo2"
  174. obj2.Parent=holsters
  175. --3-Mesh
  176. obj3=Instance.new("BlockMesh")
  177. obj3.Scale=Vector3.new(0.999499977,1,1)
  178. obj3.Parent=obj2
  179. --4-Belt
  180. obj4=Instance.new("Part")
  181. obj4.CFrame=CFrame.new(Vector3.new(13.6000061,1.49000156,35.8999977)) * CFrame.Angles(-1.4901162970204e-008,0,-0)
  182. obj4.FormFactor=Enum.FormFactor.Custom
  183. obj4.LeftSurface=10
  184. obj4.TopSurface=10
  185. obj4.RightSurface=10
  186. obj4.Material="SmoothPlastic"
  187. obj4.Size=Vector3.new(2,0.200000003,1)
  188. obj4.FrontSurface=10
  189. obj4.BottomSurface=10
  190. obj4.BackSurface=10
  191. obj4.BrickColor=BrickColor.new("Dark stone grey")
  192. obj4.Name="Belt"
  193. obj4.Parent=holsters
  194. --5-Mesh
  195. obj5=Instance.new("BlockMesh")
  196. obj5.Scale=Vector3.new(1.10000002,1,1.10000002)
  197. obj5.Parent=obj4
  198. --6-Hold2
  199. obj6=Instance.new("Part")
  200. obj6.CFrame=CFrame.new(Vector3.new(14.8000011,1.0950017,35.6999893)) * CFrame.Angles(0.26179936528206,0,-0)
  201. obj6.FormFactor=Enum.FormFactor.Custom
  202. obj6.LeftSurface=10
  203. obj6.TopSurface=10
  204. obj6.RightSurface=10
  205. obj6.Material="SmoothPlastic"
  206. obj6.Size=Vector3.new(0.400000006,1.00999999,0.600000024)
  207. obj6.FrontSurface=10
  208. obj6.BottomSurface=10
  209. obj6.BackSurface=10
  210. obj6.BrickColor=BrickColor.new("Dark stone grey")
  211. obj6.Name="Hold2"
  212. obj6.Parent=holsters
  213. --7-TorsoWeld
  214. obj7=Instance.new("Part")
  215. obj7.CFrame=CFrame.new(Vector3.new(13.6000061,1.99000168,35.8999939)) * CFrame.Angles(-0,0,-0)
  216. obj7.FormFactor=Enum.FormFactor.Custom
  217. obj7.LeftSurface=10
  218. obj7.Transparency=1
  219. obj7.TopSurface=10
  220. obj7.RightSurface=10
  221. obj7.Size=Vector3.new(2,2,1)
  222. obj7.FrontSurface=10
  223. obj7.BottomSurface=10
  224. obj7.BackSurface=10
  225. obj7.BrickColor=BrickColor.new("Bright blue")
  226. obj7.Name="TorsoWeld"
  227. obj7.Parent=holsters
  228. --8-HolsterWeldTo
  229. obj8=Instance.new("Part")
  230. obj8.CFrame=CFrame.new(Vector3.new(12.342,1.44200003,35.6479988)) * CFrame.Angles(1.8325955867767,-1.4901161193848e-008,-3.1415927410126)
  231. obj8.FormFactor=Enum.FormFactor.Custom
  232. obj8.LeftSurface=10
  233. obj8.Transparency=1
  234. obj8.TopSurface=10
  235. obj8.RightSurface=10
  236. obj8.Material="SmoothPlastic"
  237. obj8.Size=Vector3.new(0.200000003,0.200000003,1.60000014)
  238. obj8.FrontSurface=10
  239. obj8.BottomSurface=10
  240. obj8.BackSurface=10
  241. obj8.BrickColor=BrickColor.new("Dark stone grey")
  242. obj8.Name="HolsterWeldTo"
  243. obj8.Parent=holsters
  244. --9-Mesh
  245. obj9=Instance.new("BlockMesh")
  246. obj9.Scale=Vector3.new(0.999499977,1,1)
  247. obj9.Parent=obj8
  248. --10-Hold
  249. obj10=Instance.new("Part")
  250. obj10.CFrame=CFrame.new(Vector3.new(12.4000053,1.09500158,35.6999893)) * CFrame.Angles(0.26179936528206,0,-0)
  251. obj10.FormFactor=Enum.FormFactor.Custom
  252. obj10.LeftSurface=10
  253. obj10.TopSurface=10
  254. obj10.RightSurface=10
  255. obj10.Material="SmoothPlastic"
  256. obj10.Size=Vector3.new(0.400000006,1.00999999,0.600000024)
  257. obj10.FrontSurface=10
  258. obj10.BottomSurface=10
  259. obj10.BackSurface=10
  260. obj10.BrickColor=BrickColor.new("Dark stone grey")
  261. obj10.Name="Hold"
  262. obj10.Parent=holsters
  263. holsters:MakeJoints()
  264. scan(holsters)
  265.  
  266. --1-M1911
  267. gun=Instance.new("Model")
  268. gun.Name="M1911"
  269. gun.Parent=char
  270. --2-Handle
  271. obj2=Instance.new("Part")
  272. obj2.CFrame=CFrame.new(Vector3.new(12.3420238,1.86332655,36.3927727)) * CFrame.Angles(1.5707963705063,-4.4703483581543e-008,3.1415927410126)
  273. obj2.FormFactor=Enum.FormFactor.Custom
  274. obj2.LeftSurface=10
  275. obj2.TopSurface=10
  276. obj2.RightSurface=10
  277. obj2.Material=Enum.Material.Wood
  278. obj2.Size=Vector3.new(0.200000003,0.99999994,0.400000036)
  279. obj2.FrontSurface=10
  280. obj2.BottomSurface=10
  281. obj2.BackSurface=10
  282. obj2.BrickColor=BrickColor.new("Brown")
  283. obj2.Name="Handle"
  284. obj2.Parent=gun
  285. --3-Decor
  286. obj3=Instance.new("Part")
  287. obj3.CFrame=CFrame.new(Vector3.new(12.3420143,2.28510284,35.9773712)) * CFrame.Angles(1.832595705986,0,-3.1415927410126)
  288. obj3.FormFactor=Enum.FormFactor.Custom
  289. obj3.LeftSurface=10
  290. obj3.TopSurface=10
  291. obj3.RightSurface=10
  292. obj3.Material="SmoothPlastic"
  293. obj3.Size=Vector3.new(0.200000003,0.200000003,0.200000003)
  294. obj3.FrontSurface=10
  295. obj3.BottomSurface=10
  296. obj3.BackSurface=10
  297. obj3.BrickColor=BrickColor.new("Dark stone grey")
  298. obj3.Name="Decor"
  299. obj3.Parent=gun
  300. --4-Mesh
  301. obj4=Instance.new("BlockMesh")
  302. obj4.Offset=Vector3.new(0,0.00999999978,0.0399999991)
  303. obj4.Scale=Vector3.new(0.699999988,0.200000003,0.800000012)
  304. obj4.Parent=obj3
  305. --5-Decor
  306. obj5=Instance.new("Part")
  307. obj5.CFrame=CFrame.new(Vector3.new(12.3420143,1.46716928,35.8617401)) * CFrame.Angles(1.8325955867767,-1.4901161193848e-008,-3.1415927410126)
  308. obj5.FormFactor=Enum.FormFactor.Custom
  309. obj5.LeftSurface=10
  310. obj5.TopSurface=10
  311. obj5.RightSurface=10
  312. obj5.Material="SmoothPlastic"
  313. obj5.Size=Vector3.new(0.200000003,0.400000006,0.200000003)
  314. obj5.FrontSurface=10
  315. obj5.BottomSurface=10
  316. obj5.BackSurface=10
  317. obj5.BrickColor=BrickColor.new("Dark stone grey")
  318. obj5.Name="Decor"
  319. obj5.Parent=gun
  320. --6-Mesh
  321. obj6=Instance.new("BlockMesh")
  322. obj6.Scale=Vector3.new(0.600000024,1,0.200000003)
  323. obj6.Parent=obj5
  324. --7-Decor
  325. obj7=Instance.new("Part")
  326. obj7.CFrame=CFrame.new(Vector3.new(12.3420124,1.55429673,36.0928192)) * CFrame.Angles(0.45686540007591,-1.1175870895386e-008,3.141592502594)
  327. obj7.FormFactor=Enum.FormFactor.Custom
  328. obj7.LeftSurface=10
  329. obj7.TopSurface=10
  330. obj7.RightSurface=10
  331. obj7.Material="SmoothPlastic"
  332. obj7.Size=Vector3.new(0.200000003,0.310000002,0.200000003)
  333. obj7.FrontSurface=10
  334. obj7.BottomSurface=10
  335. obj7.BackSurface=10
  336. obj7.BrickColor=BrickColor.new("Dark stone grey")
  337. obj7.Name="Decor"
  338. obj7.Parent=gun
  339. --8-Mesh
  340. obj8=Instance.new("BlockMesh")
  341. obj8.Scale=Vector3.new(0.600000024,1,0.200000003)
  342. obj8.Parent=obj7
  343. --9-Decor
  344. obj9=Instance.new("Part")
  345. obj9.CFrame=CFrame.new(Vector3.new(12.3420258,2.21372294,35.8965569)) * CFrame.Angles(0.76370096206665,-1.4901161193848e-008,-3.1415927410126)
  346. obj9.FormFactor=Enum.FormFactor.Custom
  347. obj9.LeftSurface=10
  348. obj9.TopSurface=10
  349. obj9.RightSurface=10
  350. obj9.Material="SmoothPlastic"
  351. obj9.Size=Vector3.new(0.200000003,0.200000003,0.200000003)
  352. obj9.FrontSurface=10
  353. obj9.BottomSurface=10
  354. obj9.BackSurface=10
  355. obj9.BrickColor=BrickColor.new("Dark stone grey")
  356. obj9.Name="Decor"
  357. obj9.Parent=gun
  358. --10-Mesh
  359. obj10=Instance.new("BlockMesh")
  360. obj10.Scale=Vector3.new(0.400000006,0.200000003,1)
  361. obj10.Parent=obj9
  362. --11-Decor
  363. obj11=Instance.new("Part")
  364. obj11.CFrame=CFrame.new(Vector3.new(12.3420229,1.8633275,36.2927704)) * CFrame.Angles(1.5707963705063,-4.4703483581543e-008,3.1415927410126)
  365. obj11.FormFactor=Enum.FormFactor.Custom
  366. obj11.LeftSurface=10
  367. obj11.TopSurface=10
  368. obj11.RightSurface=10
  369. obj11.Material="SmoothPlastic"
  370. obj11.Size=Vector3.new(0.200000003,1.20000005,0.400000036)
  371. obj11.FrontSurface=10
  372. obj11.BottomSurface=10
  373. obj11.BackSurface=10
  374. obj11.BrickColor=BrickColor.new("Dark stone grey")
  375. obj11.Name="Decor"
  376. obj11.Parent=gun
  377. --12-Mesh
  378. obj12=Instance.new("BlockMesh")
  379. obj12.Offset=Vector3.new(0,-0.0700000003,0)
  380. obj12.Scale=Vector3.new(0.995000005,0.949999988,1.20000005)
  381. obj12.Parent=obj11
  382. --13-Decor
  383. obj13=Instance.new("Part")
  384. obj13.CFrame=CFrame.new(Vector3.new(12.3420258,2.30202365,35.8373909)) * CFrame.Angles(1.756756901741,-1.0430812835693e-007,3.1415927410126)
  385. obj13.FormFactor=Enum.FormFactor.Custom
  386. obj13.LeftSurface=10
  387. obj13.TopSurface=10
  388. obj13.RightSurface=10
  389. obj13.Material="SmoothPlastic"
  390. obj13.Size=Vector3.new(0.200000003,0.200000003,0.200000003)
  391. obj13.FrontSurface=10
  392. obj13.BottomSurface=10
  393. obj13.BackSurface=10
  394. obj13.BrickColor=BrickColor.new("Dark stone grey")
  395. obj13.Name="Decor"
  396. obj13.Parent=gun
  397. --14-Mesh
  398. obj14=Instance.new("BlockMesh")
  399. obj14.Scale=Vector3.new(0.400000006,0.200000003,0.400000006)
  400. obj14.Parent=obj13
  401. --15-BulletCase
  402. obj15=Instance.new("Part")
  403. obj15.CFrame=CFrame.new(Vector3.new(12.3420229,1.44165683,35.6482697)) * CFrame.Angles(1.8325955867767,-1.4901161193848e-008,-3.1415927410126)
  404. obj15.FormFactor=Enum.FormFactor.Custom
  405. obj15.LeftSurface=10
  406. obj15.TopSurface=10
  407. obj15.RightSurface=10
  408. obj15.Material="SmoothPlastic"
  409. obj15.Size=Vector3.new(0.200000003,0.200000003,1.60000014)
  410. obj15.FrontSurface=10
  411. obj15.BottomSurface=10
  412. obj15.BackSurface=10
  413. obj15.BrickColor=BrickColor.new("Dark stone grey")
  414. obj15.Name="BulletCase"
  415. obj15.Parent=gun
  416. --16-Mesh
  417. obj16=Instance.new("BlockMesh")
  418. obj16.Scale=Vector3.new(0.999499977,1,1)
  419. obj16.Parent=obj15
  420. --17-Flashlight
  421. obj17=Instance.new("Part")
  422. obj17.CFrame=CFrame.new(Vector3.new(12.3420115,0.729269207,35.601902)) * CFrame.Angles(-2.8797931671143,-1.7763568394003e-015,-3.1415927410126)
  423. obj17.FormFactor=Enum.FormFactor.Custom
  424. obj17.LeftSurface=10
  425. obj17.TopSurface=10
  426. obj17.RightSurface=10
  427. obj17.Material="SmoothPlastic"
  428. obj17.Size=Vector3.new(0.200000003,0.200000003,0.200000003)
  429. obj17.FrontSurface=10
  430. obj17.BottomSurface=10
  431. obj17.BackSurface=10
  432. obj17.BrickColor=BrickColor.new("Pastel yellow")
  433. obj17.Name="Flashlight"
  434. obj17.Parent=gun
  435. --18-Mesh
  436. obj18=Instance.new("CylinderMesh")
  437. obj18.Offset=Vector3.new(0,0,0.0500000007)
  438. obj18.Scale=Vector3.new(0.5,1.01999998,0.5)
  439. obj18.Parent=obj17
  440. --19-Decor
  441. obj19=Instance.new("Part")
  442. obj19.CFrame=CFrame.new(Vector3.new(12.3420143,2.1178081,35.8290215)) * CFrame.Angles(1.832595705986,0,-3.1415927410126)
  443. obj19.FormFactor=Enum.FormFactor.Custom
  444. obj19.LeftSurface=10
  445. obj19.TopSurface=10
  446. obj19.RightSurface=10
  447. obj19.Material="SmoothPlastic"
  448. obj19.Size=Vector3.new(0.200000003,0.400000036,0.200000003)
  449. obj19.FrontSurface=10
  450. obj19.BottomSurface=10
  451. obj19.BackSurface=10
  452. obj19.BrickColor=BrickColor.new("Black")
  453. obj19.Name="Decor"
  454. obj19.Parent=gun
  455. --20-Mesh
  456. obj20=Instance.new("BlockMesh")
  457. obj20.Scale=Vector3.new(0.5,0.5,1.10000002)
  458. obj20.Parent=obj19
  459. --21-Decor
  460. obj21=Instance.new("Part")
  461. obj21.CFrame=CFrame.new(Vector3.new(12.2895117,2.05304575,35.6843338)) * CFrame.Angles(1.832595705986,1.5699505805969,-3.1415927410126)
  462. obj21.FormFactor=Enum.FormFactor.Custom
  463. obj21.LeftSurface=10
  464. obj21.TopSurface=10
  465. obj21.RightSurface=10
  466. obj21.Material="SmoothPlastic"
  467. obj21.Size=Vector3.new(0.399999976,0.200000003,0.200000003)
  468. obj21.FrontSurface=10
  469. obj21.BottomSurface=10
  470. obj21.BackSurface=10
  471. obj21.BrickColor=BrickColor.new("Dark stone grey")
  472. obj21.Name="Decor"
  473. obj21.Parent=gun
  474. --22-Mesh
  475. obj22=Instance.new("SpecialMesh")
  476. obj22.MeshType=Enum.MeshType.Wedge
  477. obj22.Scale=Vector3.new(1,0.25,0.50999999)
  478. obj22.Parent=obj21
  479. --23-Decor
  480. obj23=Instance.new("Part")
  481. obj23.CFrame=CFrame.new(Vector3.new(12.3420172,1.41577363,35.744442)) * CFrame.Angles(-2.8797931671143,-1.7763568394003e-015,-3.1415927410126)
  482. obj23.FormFactor=Enum.FormFactor.Custom
  483. obj23.LeftSurface=10
  484. obj23.TopSurface=10
  485. obj23.RightSurface=10
  486. obj23.Material="SmoothPlastic"
  487. obj23.Size=Vector3.new(0.200000003,1.60000002,0.200000003)
  488. obj23.FrontSurface=10
  489. obj23.BottomSurface=10
  490. obj23.BackSurface=10
  491. obj23.BrickColor=BrickColor.new("Dark stone grey")
  492. obj23.Name="Decor"
  493. obj23.Parent=gun
  494. --24-Mesh
  495. obj24=Instance.new("CylinderMesh")
  496. obj24.Parent=obj23
  497. --25-ShellCaseSpawner
  498. obj25=Instance.new("Part")
  499. obj25.CFrame=CFrame.new(Vector3.new(12.3420172,1.75731552,35.6289024)) * CFrame.Angles(-2.8797931671143,-1.7763568394003e-015,-3.1415927410126)
  500. obj25.FormFactor=Enum.FormFactor.Custom
  501. obj25.LeftSurface=10
  502. obj25.TopSurface=10
  503. obj25.RightSurface=10
  504. obj25.Material="SmoothPlastic"
  505. obj25.Size=Vector3.new(0.200000003,0.200000003,0.200000003)
  506. obj25.FrontSurface=10
  507. obj25.BottomSurface=10
  508. obj25.BackSurface=10
  509. obj25.Name="ShellCaseSpawner"
  510. obj25.Parent=gun
  511. --26-Mesh
  512. obj26=Instance.new("CylinderMesh")
  513. obj26.Offset=Vector3.new(0.0149999997,0,-0.0350000001)
  514. obj26.Scale=Vector3.new(0.75,1,0.75)
  515. obj26.Parent=obj25
  516. --27-Decor
  517. obj27=Instance.new("Part")
  518. obj27.CFrame=CFrame.new(Vector3.new(12.3420115,0.765501678,35.4666672)) * CFrame.Angles(-2.8797931671143,-1.7763568394003e-015,-3.1415927410126)
  519. obj27.FormFactor=Enum.FormFactor.Custom
  520. obj27.LeftSurface=10
  521. obj27.TopSurface=10
  522. obj27.RightSurface=10
  523. obj27.Material="SmoothPlastic"
  524. obj27.Size=Vector3.new(0.200000003,0.200000003,0.200000003)
  525. obj27.FrontSurface=10
  526. obj27.BottomSurface=10
  527. obj27.BackSurface=10
  528. obj27.BrickColor=BrickColor.new("Black")
  529. obj27.Name="Decor"
  530. obj27.Parent=gun
  531. --28-Mesh
  532. obj28=Instance.new("CylinderMesh")
  533. obj28.Offset=Vector3.new(0,0,0.0500000007)
  534. obj28.Scale=Vector3.new(0.5,1.01999998,0.5)
  535. obj28.Parent=obj27
  536. --29-Decor
  537. obj29=Instance.new("Part")
  538. obj29.CFrame=CFrame.new(Vector3.new(12.3920164,1.4734931,35.5290413)) * CFrame.Angles(-1.3089969158173,-1.5701057910919,-0)
  539. obj29.FormFactor=Enum.FormFactor.Custom
  540. obj29.LeftSurface=10
  541. obj29.TopSurface=10
  542. obj29.RightSurface=10
  543. obj29.Material="SmoothPlastic"
  544. obj29.Size=Vector3.new(1.60000002,0.200000003,0.200000003)
  545. obj29.FrontSurface=10
  546. obj29.BottomSurface=10
  547. obj29.BackSurface=10
  548. obj29.BrickColor=BrickColor.new("Dark stone grey")
  549. obj29.Name="Decor"
  550. obj29.Parent=gun
  551. --30-Mesh
  552. obj30=Instance.new("SpecialMesh")
  553. obj30.MeshType=Enum.MeshType.Wedge
  554. obj30.Scale=Vector3.new(1,0.25,0.5)
  555. obj30.Parent=obj29
  556. --31-Decor
  557. obj31=Instance.new("Part")
  558. obj31.CFrame=CFrame.new(Vector3.new(12.2895117,1.18371284,35.4513969)) * CFrame.Angles(1.832595705986,1.5699505805969,-3.1415927410126)
  559. obj31.FormFactor=Enum.FormFactor.Custom
  560. obj31.LeftSurface=10
  561. obj31.TopSurface=10
  562. obj31.RightSurface=10
  563. obj31.Material="SmoothPlastic"
  564. obj31.Size=Vector3.new(1,0.200000003,0.200000003)
  565. obj31.FrontSurface=10
  566. obj31.BottomSurface=10
  567. obj31.BackSurface=10
  568. obj31.BrickColor=BrickColor.new("Dark stone grey")
  569. obj31.Name="Decor"
  570. obj31.Parent=gun
  571. --32-Mesh
  572. obj32=Instance.new("SpecialMesh")
  573. obj32.MeshType=Enum.MeshType.Wedge
  574. obj32.Scale=Vector3.new(1,0.25,0.50999999)
  575. obj32.Parent=obj31
  576. gun:MakeJoints()
  577. scan(gun)
  578.  
  579. local gun2 = gun:clone()
  580. gun2.Parent = char
  581.  
  582. local torsoweld = Instance.new('Weld', char)
  583. torsoweld.Part0 = torso
  584. torsoweld.Part1 = holsters.TorsoWeld
  585. torsoweld.C1 = CFrame.Angles(0,math.pi,0)
  586.  
  587. local gunweld = Instance.new('Weld', char)
  588. gunweld.Part0 = gun.BulletCase
  589. gunweld.Part1 = holsters.HolsterWeldTo
  590.  
  591. local gunweld2 = Instance.new('Weld', char)
  592. gunweld2.Part0 = gun2.BulletCase
  593. gunweld2.Part1 = holsters.HolsterWeldTo2
  594.  
  595. local bodygyro = Instance.new('BodyGyro')
  596. bodygyro.maxTorque = Vector3.new(14e16,14e16,14e16)
  597. bodygyro.P = 15000
  598.  
  599. local rsc0 = rm.C0
  600. local lsc0 = lm.C0
  601. local angle = 0
  602. local anglespeed = .5
  603. local speed = .3
  604. local side = 0
  605. local Equipped = false
  606. local origneckc0 = neck.C0
  607. local origneckc1 = neck.C1
  608. local neckc0 = CFrame.new(0, 1, 0)
  609. local firing = false
  610. local pistol = 1
  611. local light = false
  612.  
  613. local gunlight = Instance.new('SpotLight', gun.Flashlight)
  614. gunlight.Range = 40
  615. gunlight.Angle = 60
  616. gunlight.Face = 'Bottom'
  617. gunlight.Shadows = true
  618. gunlight.Enabled = false
  619.  
  620. local gunlight2 = gunlight:clone()
  621. gunlight2.Parent = gun2.Flashlight
  622.  
  623. local fire = Instance.new('Sound', head)
  624. fire.SoundId = "rbxassetid://132373536"
  625. fire.Volume = 1
  626.  
  627. local reload = Instance.new('Sound', head)
  628. reload.SoundId = "rbxassetid://138109513"
  629. reload.Volume = 1
  630.  
  631. local ammo = 14
  632. local scrgui = Instance.new('ScreenGui', plrgui)
  633. scrgui.Name = 'DualGunsGui'
  634.  
  635. local ammonution = Instance.new('TextLabel', scrgui)
  636. ammonution.Size = UDim2.new(0,150,0,50)
  637. ammonution.Position = UDim2.new(1, -250, 1, -70)
  638. ammonution.BackgroundTransparency = 1
  639. ammonution.TextColor3 = Color3.new(1,1,1)
  640. ammonution.TextStrokeTransparency = .1
  641. ammonution.Text = ('| '):rep(ammo)
  642. ammonution.TextXAlignment = 'Right'
  643. ammonution.ZIndex = 2
  644. ammonution.FontSize = 'Size18'
  645.  
  646. local ammonution2 = Instance.new('TextLabel', scrgui)
  647. ammonution2.Size = UDim2.new(0,150,0,50)
  648. ammonution2.Position = UDim2.new(1, -250, 1, -70)
  649. ammonution2.BackgroundTransparency = 1
  650. ammonution2.TextColor3 = Color3.new(.5,.5,.5)
  651. ammonution2.TextStrokeTransparency = .1
  652. ammonution2.TextXAlignment = 'Right'
  653. ammonution2.Text = ('| '):rep(ammo)
  654. ammonution2.FontSize = 'Size18'
  655.  
  656. local rel = Instance.new('TextButton', scrgui)
  657. rel.Size = UDim2.new(0,500,0,250)
  658. rel.Position = UDim2.new(.5, -250, .8, -250)
  659. rel.BackgroundTransparency = 1
  660. rel.TextColor3 = Color3.new(.7,0,0)
  661. rel.Visible = false
  662. rel.Text = 'Reload (r)'
  663. rel.FontSize = 'Size24'
  664.  
  665. rel.MouseButton1Down:connect(function()
  666. if ammo >= 14 or firing then return end
  667. dontclerpneck = true
  668. firing = true
  669. local dropammo = gun.Handle:clone()
  670. dropammo:ClearAllChildren()
  671. dropammo.CanCollide = true
  672. dropammo.BrickColor = BrickColor.Black()
  673. dropammo.Parent = workspace
  674. dropammo.CFrame = gun.Handle.CFrame
  675. local dropammo2 = dropammo:clone()
  676. dropammo2.Parent = workspace
  677. dropammo2.CFrame = gun2.Handle.CFrame * CFrame.new(0, -.5, 0)
  678. game:service'Debris':AddItem(dropammo,15)
  679. game:service'Debris':AddItem(dropammo2,15)
  680. wait(.5)
  681. reload:play()
  682. for i = 1, 65 do
  683. firing = true
  684. rscf = rsc0 * CFrame.Angles(math.pi/2, 0, 0)
  685. lscf = lsc0 * CFrame.new(1.2, 0, -.4) * CFrame.Angles(math.pi/4 + math.sin(angle)*math.random()/20, math.rad(30), math.pi/3.2)
  686. lm.C0 = clerp(lm.C0,lscf,speed)
  687. rm.C0 = clerp(rm.C0,rscf,speed)
  688. game:service'RunService'.RenderStepped:wait()
  689. end
  690. reload:play()
  691. for i = 1, 65 do
  692. firing = true
  693. rscf = rsc0 * CFrame.new(-1.2, 0, -.4) * CFrame.Angles(math.pi/4 + math.sin(angle)*math.random()/20, -math.rad(30), -math.pi/3.2)
  694. lscf = lsc0 * CFrame.Angles(math.pi/2, 0, 0)
  695. lm.C0 = clerp(lm.C0,lscf,speed)
  696. rm.C0 = clerp(rm.C0,rscf,speed)
  697. game:service'RunService'.RenderStepped:wait()
  698. end
  699. dontclerpneck = false
  700. firing = false
  701. ammo = 14
  702. ammonution.Text = ('| '):rep(ammo)
  703. end)
  704. tool.Selected:connect(function(mouse)
  705. Equipped = true
  706. bodygyro.Parent = torso
  707. bodygyro.cframe = torso.CFrame
  708. rs.Parent = nil
  709. ls.Parent = nil
  710. rm.Parent = torso
  711. lm.Parent = torso
  712. neck.C0 = CFrame.new(0, 1, 0)
  713. neck.C1 = CFrame.new(0, -0.5, 0)
  714. gunweld.Part0 = gun.Handle
  715. gunweld2.Part0 = gun2.Handle
  716. gunweld.Part1 = ra
  717. gunweld2.Part1 = la
  718. gunweld.C1 = CFrame.new(0, -.8, 0)
  719. gunweld.C0 = CFrame.Angles(math.pi/2-math.rad(15), 0, math.pi)
  720. gunweld2.C1 = CFrame.new(0, -.8, 0)
  721. gunweld2.C0 = CFrame.Angles(math.pi/2-math.rad(15), 0, math.pi)
  722. mouse.KeyDown:connect(function(k)
  723. if k == "r" then
  724. if ammo >= 14 or firing then return end
  725. dontclerpneck = true
  726. firing = true
  727. local dropammo = gun.Handle:clone()
  728. dropammo:ClearAllChildren()
  729. dropammo.CanCollide = true
  730. dropammo.BrickColor = BrickColor.Black()
  731. dropammo.Parent = workspace
  732. dropammo.CFrame = gun.Handle.CFrame
  733. local dropammo2 = dropammo:clone()
  734. dropammo2.Parent = workspace
  735. dropammo2.CFrame = gun2.Handle.CFrame * CFrame.new(0, -.5, 0)
  736. game:service'Debris':AddItem(dropammo,15)
  737. game:service'Debris':AddItem(dropammo2,15)
  738. wait(.5)
  739. reload:play()
  740. for i = 1, 65 do
  741. firing = true
  742. rscf = rsc0 * CFrame.Angles(math.pi/2, 0, 0)
  743. lscf = lsc0 * CFrame.new(1.2, 0, -.4) * CFrame.Angles(math.pi/4 + math.sin(angle)*math.random()/20, math.rad(30), math.pi/3.2)
  744. lm.C0 = clerp(lm.C0,lscf,speed)
  745. rm.C0 = clerp(rm.C0,rscf,speed)
  746. game:service'RunService'.RenderStepped:wait()
  747. end
  748. reload:play()
  749. for i = 1, 65 do
  750. firing = true
  751. rscf = rsc0 * CFrame.new(-1.2, 0, -.4) * CFrame.Angles(math.pi/4 + math.sin(angle)*math.random()/20, -math.rad(30), -math.pi/3.2)
  752. lscf = lsc0 * CFrame.Angles(math.pi/2, 0, 0)
  753. lm.C0 = clerp(lm.C0,lscf,speed)
  754. rm.C0 = clerp(rm.C0,rscf,speed)
  755. game:service'RunService'.RenderStepped:wait()
  756. end
  757. dontclerpneck = false
  758. firing = false
  759. ammo = 14
  760. ammonution.Text = ('| '):rep(ammo)
  761. end
  762. if k == "f" then
  763. light = not light
  764. local sound = Instance.new('Sound', head)
  765. sound.SoundId = "rbxassetid://115959318"
  766. sound.Volume = 1
  767. sound:play()
  768. game:service'Debris':AddItem(sound,1)
  769. end
  770. end)
  771. mouse.Button1Down:connect(function()
  772. if ammo <= 0 then
  773. local sound = Instance.new('Sound', head)
  774. sound.SoundId = "rbxassetid://132464034"
  775. sound.Volume = 1
  776. sound:play()
  777. game:service'Debris':AddItem(sound,1)
  778. end
  779. if firing or ammo <= 0 then return end
  780. ammo = ammo - 1
  781. ammonution.Text = ('| '):rep(ammo)
  782. firing = true
  783. local pa = Instance.new('Part')
  784. pa.CanCollide = false
  785. pa.Anchored = true
  786. pa.Locked = true
  787. pa.FormFactor = 'Custom'
  788. pa.BrickColor = BrickColor.new('New Yeller')
  789. pa.Size = Vector3.new(.2,3,.2)
  790. Instance.new('BlockMesh', pa).Scale = Vector3.new(.2,3,.2)
  791. local thegun
  792. if pistol == 1 then
  793. thegun = gun.BulletCase
  794. elseif pistol == 2 then
  795. thegun = gun2.BulletCase
  796. end
  797. local muzzle = Instance.new('PointLight', thegun)
  798. muzzle.Range = 12
  799. muzzle.Color = Color3.new(1,.6,.1)
  800. game:service'Debris':AddItem(muzzle, .05)
  801. local shell = pa:clone()
  802. shell:ClearAllChildren()
  803. shell.Anchored = false
  804. shell.CFrame = thegun.Parent.ShellCaseSpawner.CFrame
  805. shell.Size = Vector3.new(.2,.5,.2)
  806. shell.Parent = workspace
  807. shell.BrickColor = BrickColor.new('Bright yellow')
  808. shell.CanCollide = true
  809. game:service'Debris':AddItem(shell, 5)
  810. local bulletpos = thegun.Position
  811. local bulletvelocity = (mouse.Hit.p - bulletpos).unit*15
  812. local lastbulletpos = thegun.Position
  813. fire:play()
  814. coroutine.wrap(function()
  815. while game:service'RunService'.Stepped:wait() do
  816. lastbulletpos = bulletpos
  817. bulletpos = bulletpos + bulletvelocity
  818. local RayCast = Ray.new(lastbulletpos, (bulletpos - lastbulletpos))
  819. local hit, hitpos = workspace:FindPartOnRay(RayCast, char)
  820. if (torso.Position - pa.Position).magnitude > 800 then
  821. pa:Destroy()
  822. break
  823. end
  824. pa.Anchored = true
  825. pa.CFrame = CFrame.new(bulletpos, bulletpos+bulletvelocity) * CFrame.Angles(math.pi/2, 0, 0)
  826. if hit then
  827. local damage
  828. local sound = Instance.new('Sound', pa)
  829. sound.SoundId = "rbxassetid://166423137"
  830. sound.Pitch = 1.2+math.random()/3
  831. sound.Volume = 1
  832. sound:play()
  833. pa:Destroy()
  834. game:service'Debris':AddItem(sound,4)
  835. local ray = Ray.new(rootpart.Position, Vector3.new(0, -6, 0))
  836. local hitz, enz = workspace:FindPartOnRay(ray, char)
  837. local hum = hit and hit.Parent and hit.Parent:findFirstChild'Humanoid'
  838. if hum then
  839. damage = math.random(5,10)
  840. hum:TakeDamage(damage)
  841. end
  842. local hum = hit and hit.Parent and hit.Parent.Parent and hit.Parent.Parent:findFirstChild'Humanoid'
  843. if hum then
  844. damage = math.random(5,10)
  845. hum:TakeDamage(damage)
  846. end
  847. break
  848. end
  849. pa.Anchored = true
  850. pa.Parent = char
  851. pa.CFrame = CFrame.new(bulletpos, bulletpos+bulletvelocity) * CFrame.Angles(math.pi/2, 0, 0)
  852. end
  853. end)()
  854.  
  855. if pistol == 1 then
  856. pistol = 2
  857. for i = 1, 4 do
  858. rscf = CFrame.new(Vector3.new(rsc0.x, rsc0.y, rsc0.z), torso.CFrame:pointToObjectSpace(plrmouse.Hit.p)) * CFrame.new(0, 0, .5) * CFrame.Angles(math.pi/1.5 + math.sin(angle)*math.random()/20, 0, math.cos(angle)*math.random()/20)
  859. lscf = CFrame.new(Vector3.new(lsc0.x, lsc0.y, lsc0.z), torso.CFrame:pointToObjectSpace(plrmouse.Hit.p)) * CFrame.Angles(math.pi/2 + math.sin(angle)*math.random()/20, 0, -math.cos(angle)*math.random()/20)
  860. lm.C0 = clerp(lm.C0,lscf,speed)
  861. rm.C0 = clerp(rm.C0,rscf,speed)
  862. game:service'RunService'.RenderStepped:wait()
  863. end
  864. elseif pistol == 2 then
  865. for i = 1, 4 do
  866. rscf = CFrame.new(Vector3.new(rsc0.x, rsc0.y, rsc0.z), torso.CFrame:pointToObjectSpace(plrmouse.Hit.p)) * CFrame.Angles(math.pi/2 + math.sin(angle)*math.random()/20, 0, math.cos(angle)*math.random()/20)
  867. lscf = CFrame.new(Vector3.new(lsc0.x, lsc0.y, lsc0.z), torso.CFrame:pointToObjectSpace(plrmouse.Hit.p)) * CFrame.new(0, 0, .5) * CFrame.Angles(math.pi/1.5 + math.sin(angle)*math.random()/20, 0, -math.cos(angle)*math.random()/20)
  868. lm.C0 = clerp(lm.C0,lscf,speed)
  869. rm.C0 = clerp(rm.C0,rscf,speed)
  870. game:service'RunService'.RenderStepped:wait()
  871. end
  872. pistol = 1
  873. end
  874. firing = false
  875. end)
  876. end)
  877. tool.Deselected:connect(function()
  878. Equipped = false
  879. rm.Parent = nil
  880. lm.Parent = nil
  881. rs.Parent = torso
  882. ls.Parent = torso
  883. neck.C0 = origneckc0
  884. neck.C1 = origneckc1
  885. lm.C0 = lsc0
  886. rm.C0 = rsc0
  887. gunweld.Part0 = gun.BulletCase
  888. gunweld.Part1 = holsters.HolsterWeldTo
  889. gunweld.C0 = CFrame.new()
  890. gunweld.C1 = CFrame.new()
  891. gunweld2.Part0 = gun2.BulletCase
  892. gunweld2.Part1 = holsters.HolsterWeldTo2
  893. gunweld2.C0 = CFrame.new()
  894. gunweld2.C1 = CFrame.new()
  895. bodygyro.Parent = nil
  896. end)
  897.  
  898. game:service'RunService'.RenderStepped:connect(function()
  899. if Equipped then
  900. if ammo <= 0 then
  901. rel.Visible = true
  902. else
  903. rel.Visible = false
  904. end
  905. if light then
  906. gunlight.Enabled = true
  907. gunlight2.Enabled = true
  908. else
  909. gunlight.Enabled = false
  910. gunlight2.Enabled = false
  911. end
  912. angle = angle + (0.05+math.random()/20)
  913. local rscf = rsc0
  914. local lscf = lsc0
  915. local ncf = neckc0
  916. local rmx,rmy,rmz = rm.C0:toEulerAnglesXYZ()
  917. if rmz >= 1 then
  918. bodygyro.cframe = bodygyro.cframe * CFrame.Angles(0, -rmz/5, 0)
  919. elseif rmz <= -1 then
  920. bodygyro.cframe = bodygyro.cframe * CFrame.Angles(0, -rmz/5, 0)
  921. end
  922. rscf = CFrame.new(Vector3.new(rsc0.x, rsc0.y, rsc0.z), torso.CFrame:pointToObjectSpace(plrmouse.Hit.p)) * CFrame.Angles(math.pi/2 + math.sin(angle)*math.random()/20, 0, math.cos(angle)*math.random()/20)
  923. lscf = CFrame.new(Vector3.new(lsc0.x, lsc0.y, lsc0.z), torso.CFrame:pointToObjectSpace(plrmouse.Hit.p)) * CFrame.Angles(math.pi/2 + math.sin(angle)*math.random()/20, 0, -math.cos(angle)*math.random()/20)
  924. ncf = neckc0 * CFrame.new(Vector3.new(), torso.CFrame:pointToObjectSpace(plrmouse.Hit.p))
  925. if not firing then
  926. lm.C0 = clerp(lm.C0,lscf,speed)
  927. rm.C0 = clerp(rm.C0,rscf,speed)
  928. end
  929. if not dontclerpneck then
  930. neck.C0 = clerp(neck.C0,ncf,speed)
  931. end
  932. end
  933. if light and not Equipped then
  934. gunlight.Enabled = false
  935. gunlight2.Enabled = false
  936. end
  937. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement