Advertisement
RoDelicia

Untitled

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