Advertisement
RoDelicia

Untitled

Dec 7th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 37.05 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. --[[Dual pistols Frostftw]]--
  88. wait();
  89. Services = setmetatable({},{__index = function(t,i)
  90. return game:service(i) or nil
  91. end})
  92. plr = owner
  93. char = plr.Character
  94. Humans = char:findFirstChild("Humanoid")
  95. BulletTable,Disposables,Lasers = {},{},{}
  96. Clips,Bullets,CurrentGun = 2500,20,1
  97. GunShot = {
  98. Sound = "rbxassetid://131205975",
  99. Pitch = 1,
  100. Volume = 1,
  101. }
  102. Reloading,FlashLight,LaserLight,Silenced,LockHead,Deselectd,ToolName,LaserColor = false,false,false,false,false,false,"Dual Pistols","Gold"
  103. V3,BC,CF = Vector3.new,BrickColor.new,CFrame
  104. for i,v in pairs(plr.Character:GetChildren()) do
  105. if v:IsA("Model") and v.Name == "MainModel" then
  106. v:Remove()
  107. end
  108. end
  109. for i,v in pairs(plr.Backpack:GetChildren()) do
  110. if v.Name == ToolName then
  111. v:Remove()
  112. end
  113. end
  114. Bin = Instance.new("HopperBin",plr.Backpack)
  115. Bin.Name = ToolName
  116. MainModel,GunModelOne,GunModelTwo,SheathOne,SheathTwo,Eff = Instance.new("Model"),Instance.new("Model"),Instance.new("Model"),Instance.new("Model"),Instance.new("Model"),Instance.new("Model")
  117. MainModel.Name,GunModelOne.Name,GunModelTwo.Name,SheathOne.Name,SheathTwo.Name,Eff.Name = "MainModel","GunModelOne","GunModelTwo","SheathOne","SheathTwo","Eff"
  118. MainModel.Parent,GunModelOne.Parent,GunModelTwo.Parent,SheathOne.Parent,SheathTwo.Parent,Eff.Parent = char,MainModel,MainModel,MainModel,MainModel,MainModel
  119. L1,L2,L3,L4 = Instance.new("SpotLight"), Instance.new("SpotLight"), Instance.new("SpotLight"), Instance.new("SpotLight")
  120. L1.Enabled,L2.Enabled,L3.Enabled,L4.Enabled = false,false,false,false
  121. L1.Brightness,L2.Brightness,L3.Brightness,L4.Brightness = 60,60,40,40
  122. L1.Range,L2.Range,L3.Range,L4.Range = 25,25,40,40
  123. L1.Color,L2.Color,L3.Color,L4.Color = BrickColor.new("Neon orange").Color,BrickColor.new("Neon orange").Color,BrickColor.new("Gold").Color,BrickColor.new("Gold").Color
  124. L3.Name,L4.Name = "Safe","Safe"
  125. script.Parent = MainModel
  126. function AddPart(name,parent,s1,s2,s3,color)
  127. p=Instance.new("Part",parent)
  128. p.Name=name
  129. p.formFactor="Custom"
  130. p.Anchored=false
  131. p.Locked=true
  132. p.CanCollide=false
  133. p.Size=Vector3.new(s1,s2,s3)
  134. p.TopSurface = "Smooth"
  135. p.BottomSurface = "Smooth"
  136. p.BrickColor=BrickColor.new(color)
  137. Instance.new("BlockMesh",p).Name = "Mesh"
  138. p:BreakJoints()
  139. return p
  140. end
  141. function AddWeld(name,parent,p1,p0,c1,c0)
  142. we=Instance.new("Weld",parent)
  143. we.Part1=p1
  144. we.Part0=p0
  145. we.C1=c0
  146. we.C0=c1
  147. return we
  148. end
  149. --Gets a bit confusing down below :3
  150. HandleOne,HandleTwo = AddPart("HandleLeft",GunModelOne,.02,1,.4,"Really black"),AddPart("HandleLeft",GunModelTwo,.02,1,.4,"Really black")
  151. HandleWeldLeft,HandleWeldRight = AddWeld("Weld",HandleOne,HandleOne,char["Torso"],CF.new(-1,0,-1),CF.Angles(math.rad(45),math.rad(180),0)),AddWeld("Weld",HandleTwo,HandleTwo,char["Torso"],CF.new(1,0,-1),CF.Angles(math.rad(45),math.rad(180),0))
  152. HandLeft = AddPart("HandLeft",MainModel,1,1,1,"Really black")
  153. HandRight = AddPart("HandRight",MainModel,1,1,1,"Really black")
  154. HandLeft.Transparency,HandRight.Transparency = 1,1
  155. AddWeld("Weld",HandLeft,HandLeft,char["Left Arm"],CF.new(0,-1,0),CF.Angles(math.rad(90),0,0))
  156. AddWeld("Weld",HandRight,HandRight,char["Right Arm"],CF.new(0,-1,0),CF.Angles(math.rad(90),0,0))
  157. PA1 = AddPart("Part",GunModelOne,.3,.1,1,"Really black")
  158. PA1.Mesh.Scale = V3(1,.6,1)
  159. WPA1 = AddWeld("Weld",PA1,PA1,HandleOne,CF.new(0,0.5,-.3),CF.new(0,0,0))
  160. PA2 = AddPart("Part",GunModelOne,.1,.5,.1,"Gold")
  161. PA2.Mesh:Remove()
  162. Instance.new("CylinderMesh",PA2).Scale = V3(.5,1,.5)
  163. WPA2 = AddWeld("Weld",PA2,PA2,HandleOne,CF.new(0,.6,-.9),CF.Angles(math.rad(90),0,0))
  164. PA3 = AddPart("Part",GunModelOne,.1,1.3,.1,"Gold")
  165. PA3.Mesh:Remove()
  166. Instance.new("CylinderMesh",PA3).Scale = V3(.7,1,.8)
  167. WPA3 = AddWeld("Weld",PA3,PA3,HandleOne,CF.new(0,.75,-.6),CF.Angles(math.rad(90),0,0))
  168. PA4 = AddPart("Part",GunModelOne,.3,.1,1.2,"Really black")
  169. PA4.Mesh.Scale = V3(1,1,1)
  170. WPA4 = AddWeld("Weld",PA4,PA4,HandleOne,CF.new(0,.65,-.5),CF.new(0,0,0))
  171. PA5 = AddPart("Part",GunModelOne,.3,.1,.3,"Really black")
  172. PA5.Mesh:Remove()
  173. Instance.new("CylinderMesh",PA5).Scale = V3(1,1,1)
  174. WPA5 = AddWeld("Weld",PA5,PA5,PA4,CF.new(0,0.1,-0.5),CF.Angles(math.rad(90),0,0))
  175. PA6 = AddPart("Part",GunModelOne,.3,.5,.3,"Really black")
  176. PA6.Mesh:Remove()
  177. Instance.new("CylinderMesh",PA6).Scale = V3(1,1,1)
  178. WPA6 = AddWeld("Weld",PA6,PA6,PA4,CF.new(0,0.1,0.35),CF.Angles(math.rad(90),0,0))
  179. PA7 = AddPart("Part",GunModelOne,.1,.1,.5,"Really black")
  180. PA7.Mesh:Remove()
  181. Instance.new("CylinderMesh",PA7).Scale = V3(.9,.9,1)
  182. WPA7 = AddWeld("Weld",PA7,PA7,PA3,CF.new(0,-0.31,0),CF.Angles(0,0,0))
  183. BamOne = Instance.new("Sound",PA7)
  184. BamOne.Pitch,BamOne.Volume,BamOne.SoundId = GunShot.Pitch,GunShot.Volume,GunShot.Sound
  185. PA8 = AddPart("Part",GunModelOne,.3,.1,.25,"Really black")
  186. PA8.Mesh:Remove()
  187. sm = Instance.new("SpecialMesh",PA8)
  188. sm.MeshType = "Wedge"
  189. sm.Scale = V3(.38,.6,1)
  190. WPA8 = AddWeld("Weld",PA8,PA8,PA6,CF.new(0.1,-.3,-0.07),CF.Angles(math.rad(180),0,0))
  191. PA9 = AddPart("Part",GunModelOne,.3,.1,.25,"Really black")
  192. PA9.Mesh:Remove()
  193. sm = Instance.new("SpecialMesh",PA9)
  194. sm.MeshType = "Wedge"
  195. sm.Scale = V3(.35,.6,1)
  196. WPA9 = AddWeld("Weld",PA9,PA9,PA6,CF.new(-0.1,-.3,-0.07),CF.Angles(math.rad(180),0,0))
  197. PA10 = AddPart("Part",GunModelOne,.3,.1,.25,"Really black")
  198. PA10.Mesh:Remove()
  199. sm = Instance.new("SpecialMesh",PA10)
  200. sm.MeshType = "Wedge"
  201. sm.Scale = V3(.35,.6,1)
  202. WPA10 = AddWeld("Weld",PA10,PA10,PA6,CF.new(0,-.34,0),CF.Angles(math.rad(100),0,0))
  203. PA11 = AddPart("Part",GunModelOne,.1,.3,.1,"Really black")
  204. PA11.Mesh:Remove()
  205. sm = Instance.new("SpecialMesh",PA11)
  206. sm.MeshType = "Wedge"
  207. sm.Scale = V3(.5,1,.5)
  208. WPA11 = AddWeld("Weld",PA11,PA11,HandleOne,CF.new(0,.25,-.35),CF.Angles(math.rad(90),0,0))
  209. PA12 = AddPart("Part",GunModelOne,.1,.1,.3,"Really black")
  210. PA12.Mesh:Remove()
  211. sm = Instance.new("SpecialMesh",PA12)
  212. sm.MeshType = "Wedge"
  213. sm.Scale = V3(.5,.5,.5)
  214. WPA12 = AddWeld("Weld",PA12,PA12,HandleOne,CF.new(0,.37,-.55),CF.Angles(math.rad(90),0,0))
  215. PA13 = AddPart("Part",GunModelOne,.1,.1,.3,"Really black")
  216. PA13.Mesh:Remove()
  217. sm = Instance.new("SpecialMesh",PA13)
  218. sm.MeshType = "Wedge"
  219. sm.Scale = V3(.5,.5,.5)
  220. WPA13 = AddWeld("Weld",PA13,PA13,HandleOne,CF.new(0,.37,-.45),CF.Angles(math.rad(270),0,0))
  221. PA14 = AddPart("Part",GunModelOne,.1,.1,.3,"Really black")
  222. PA14.Mesh:Remove()
  223. sm = Instance.new("SpecialMesh",PA14)
  224. sm.MeshType = "Wedge"
  225. sm.Scale = V3(.5,.5,.5)
  226. WPA14 = AddWeld("Weld",PA14,PA14,HandleOne,CF.new(0,.4,-.3),CF.Angles(math.rad(55),0,0))
  227. PA15 = AddPart("Part",GunModelOne,.1,.3,.3,"Really black")
  228. PA15.Mesh:Remove()
  229. sm = Instance.new("SpecialMesh",PA15)
  230. sm.MeshType = "Wedge"
  231. sm.Scale = V3(1,1,.25)
  232. WPA15 = AddWeld("Weld",PA15,PA15,HandleOne,CF.new(0,-0.35,-.23),CF.Angles(math.rad(0),0,0))
  233. PA16 = AddPart("Part",GunModelOne,.02,1,.3,"Gold")
  234. PA16.Mesh.Scale = V3(1.1,.9,1)
  235. WPA16 = AddWeld("Weld",PA16,PA16,HandleOne,CF.new(0,0,0),CF.new(0,0,0))
  236. PA17 = AddPart("Part",GunModelOne,.1,.3,.3,"Gold")
  237. PA17.Mesh:Remove()
  238. sm = Instance.new("SpecialMesh",PA17)
  239. sm.MeshType = "Wedge"
  240. sm.Scale = V3(1.1,1,.25)
  241. WPA17 = AddWeld("Weld",PA17,PA17,PA15,CF.new(0,0.05,0.05),CF.Angles(math.rad(0),0,0))
  242. PA18 = AddPart("Part",GunModelOne,.1,.3,.1,"Gold")
  243. PA18.Mesh:Remove()
  244. Instance.new("CylinderMesh",PA18).Scale = V3(.5,.8,.5)
  245. WPA18 = AddWeld("Weld",PA18,PA18,HandleOne,CF.new(0,0.2,0),CF.Angles(math.rad(90),math.rad(90),0))
  246. PA19 = AddPart("Part",GunModelOne,.1,.3,.1,"Really black")
  247. PA19.Mesh:Remove()
  248. Instance.new("CylinderMesh",PA19).Scale = V3(.5,1,.5)
  249. WPA19 = AddWeld("Weld",PA19,PA19,PA3,CF.new(0,0.51,0),CF.Angles(math.rad(0),math.rad(0),0))
  250. PA20 = AddPart("Part",GunModelOne,.1,.3,.1,"Really black")
  251. PA20.Mesh:Remove()
  252. PA20.Transparency = 1
  253. L2.Parent = PA20
  254. L3.Parent = PA20
  255. WPA20 = AddWeld("Weld",PA20,PA20,PA3,CF.new(0,0.6,0),CF.Angles(math.rad(261),0,0))
  256. PA21 = AddPart("Part",GunModelOne,.1,.25,.1,"Really black")
  257. WPA21 = AddWeld("Weld",PA21,PA21,PA3,CF.new(0,0.1,-0.35),CF.Angles(math.rad(0),0,0))
  258. PA22 = AddPart("Part",GunModelOne,.1,.35,.3,"Really black")
  259. WPA22 = AddWeld("Weld",PA21,PA21,PA22,CF.new(0,0,0.2),CF.Angles(math.rad(0),0,0))
  260. PA23 = AddPart("Part",GunModelOne,.1,.35,.1,"Gold")
  261. PA23.Mesh:Remove()
  262. PA23.Transparency = 0.4
  263. Instance.new("CylinderMesh",PA23).Scale = Vector3.new(0.5,1,0.5)
  264. WPA23 = AddWeld("Weld",PA22,PA22,PA23,CF.new(0,-0.03,0.05),CF.Angles(math.rad(0),0,0))
  265. PA24 = AddPart("Part",GunModelOne,.1,.35,.1,"Really black")
  266. PA24.Mesh:Remove()
  267. PA24.Transparency = 1
  268. Instance.new("CylinderMesh",PA24).Scale = Vector3.new(0.5,1,0.5)
  269. WPA24 = AddWeld("Weld",PA22,PA22,PA24,CF.new(0,-0.03,-0.06),CF.Angles(math.rad(90),0,0))
  270. PA26 = AddPart("Part",GunModelOne,.1,.35,.1,LaserColor)
  271. PA26.Mesh:Remove()
  272. PA26.Transparency = 0.4
  273. Instance.new("CylinderMesh",PA26).Scale = Vector3.new(0.5,1,0.5)
  274. WPA26 = AddWeld("Weld",PA22,PA22,PA26,CF.new(0,-0.03,-0.06),CF.Angles(math.rad(0),0,0))
  275. --Gun 2 Below
  276. PB1 = AddPart("Part",GunModelTwo,.3,.1,1,"Really black")
  277. PB1.Mesh.Scale = V3(1,.6,1)
  278. WPB1 = AddWeld("Weld",PB1,PB1,HandleTwo,CF.new(0,0.5,-.3),CF.new(0,0,0))
  279. PB2 = AddPart("Part",GunModelTwo,.1,.5,.1,"Gold")
  280. PB2.Mesh:Remove()
  281. Instance.new("CylinderMesh",PB2).Scale = V3(.5,1,.5)
  282. WPB2 = AddWeld("Weld",PB2,PB2,HandleTwo,CF.new(0,.6,-.9),CF.Angles(math.rad(90),0,0))
  283. PB3 = AddPart("Part",GunModelTwo,.1,1.3,.1,"Gold")
  284. PB3.Mesh:Remove()
  285. Instance.new("CylinderMesh",PB3).Scale = V3(.7,1,.8)
  286. WPB3 = AddWeld("Weld",PB3,PB3,HandleTwo,CF.new(0,.75,-.6),CF.Angles(math.rad(90),0,0))
  287. PB4 = AddPart("Part",GunModelTwo,.3,.1,1.2,"Really black")
  288. PB4.Mesh.Scale = V3(1,1,1)
  289. WPB4 = AddWeld("Weld",PB4,PB4,HandleTwo,CF.new(0,.65,-.5),CF.new(0,0,0))
  290. PB5 = AddPart("Part",GunModelTwo,.3,.1,.3,"Really black")
  291. PB5.Mesh:Remove()
  292. Instance.new("CylinderMesh",PB5).Scale = V3(1,1,1)
  293. WPB5 = AddWeld("Weld",PB5,PB5,PB4,CF.new(0,0.1,-0.5),CF.Angles(math.rad(90),0,0))
  294. PB6 = AddPart("Part",GunModelTwo,.3,.5,.3,"Really black")
  295. PB6.Mesh:Remove()
  296. Instance.new("CylinderMesh",PB6).Scale = V3(1,1,1)
  297. WPB6 = AddWeld("Weld",PB6,PB6,PB4,CF.new(0,0.1,0.35),CF.Angles(math.rad(90),0,0))
  298. PB7 = AddPart("Part",GunModelTwo,.1,.1,.5,"Really black")
  299. PB7.Mesh:Remove()
  300. Instance.new("CylinderMesh",PB7).Scale = V3(.9,.9,1)
  301. WPB7 = AddWeld("Weld",PB7,PB7,PB3,CF.new(0,-0.31,0),CF.Angles(0,0,0))
  302. BamTwo = Instance.new("Sound",PB7)
  303. BamTwo.Pitch,BamTwo.Volume,BamTwo.SoundId = GunShot.Pitch,GunShot.Volume,GunShot.Sound
  304. PB8 = AddPart("Part",GunModelTwo,.3,.1,.25,"Really black")
  305. PB8.Mesh:Remove()
  306. sm = Instance.new("SpecialMesh",PB8)
  307. sm.MeshType = "Wedge"
  308. sm.Scale = V3(.38,.6,1)
  309. WPB8 = AddWeld("Weld",PB8,PB8,PB6,CF.new(0.1,-.3,-0.07),CF.Angles(math.rad(180),0,0))
  310. PB9 = AddPart("Part",GunModelOne,.3,.1,.25,"Really black")
  311. PB9.Mesh:Remove()
  312. sm = Instance.new("SpecialMesh",PB9)
  313. sm.MeshType = "Wedge"
  314. sm.Scale = V3(.35,.6,1)
  315. WPB9 = AddWeld("Weld",PB9,PB9,PB6,CF.new(-0.1,-.3,-0.07),CF.Angles(math.rad(180),0,0))
  316. PB10 = AddPart("Part",GunModelTwo,.3,.1,.25,"Really black")
  317. PB10.Mesh:Remove()
  318. sm = Instance.new("SpecialMesh",PB10)
  319. sm.MeshType = "Wedge"
  320. sm.Scale = V3(.35,.6,1)
  321. WPB10 = AddWeld("Weld",PB10,PB10,PB6,CF.new(0,-.34,0),CF.Angles(math.rad(100),0,0))
  322. PB11 = AddPart("Part",GunModelTwo,.1,.3,.1,"Really black")
  323. PB11.Mesh:Remove()
  324. sm = Instance.new("SpecialMesh",PB11)
  325. sm.MeshType = "Wedge"
  326. sm.Scale = V3(.5,1,.5)
  327. WPB11 = AddWeld("Weld",PB11,PB11,HandleTwo,CF.new(0,.25,-.35),CF.Angles(math.rad(90),0,0))
  328. PB12 = AddPart("Part",GunModelTwo,.1,.1,.3,"Really black")
  329. PB12.Mesh:Remove()
  330. sm = Instance.new("SpecialMesh",PB12)
  331. sm.MeshType = "Wedge"
  332. sm.Scale = V3(.5,.5,.5)
  333. WPB12 = AddWeld("Weld",PB12,PB12,HandleTwo,CF.new(0,.37,-.55),CF.Angles(math.rad(90),0,0))
  334. PB13 = AddPart("Part",GunModelTwo,.1,.1,.3,"Really black")
  335. PB13.Mesh:Remove()
  336. sm = Instance.new("SpecialMesh",PB13)
  337. sm.MeshType = "Wedge"
  338. sm.Scale = V3(.5,.5,.5)
  339. WPB13 = AddWeld("Weld",PB13,PB13,HandleTwo,CF.new(0,.37,-.45),CF.Angles(math.rad(270),0,0))
  340. PB14 = AddPart("Part",GunModelTwo,.1,.1,.3,"Really black")
  341. PB14.Mesh:Remove()
  342. sm = Instance.new("SpecialMesh",PB14)
  343. sm.MeshType = "Wedge"
  344. sm.Scale = V3(.5,.5,.5)
  345. WPB14 = AddWeld("Weld",PB14,PB14,HandleTwo,CF.new(0,.4,-.3),CF.Angles(math.rad(55),0,0))
  346. PB15 = AddPart("Part",GunModelTwo,.1,.3,.3,"Really black")
  347. PB15.Mesh:Remove()
  348. sm = Instance.new("SpecialMesh",PB15)
  349. sm.MeshType = "Wedge"
  350. sm.Scale = V3(1,1,.25)
  351. WPB15 = AddWeld("Weld",PB15,PB15,HandleTwo,CF.new(0,-0.35,-.23),CF.Angles(math.rad(0),0,0))
  352. PB16 = AddPart("Part",GunModelTwo,.02,1,.3,"Gold")
  353. PB16.Mesh.Scale = V3(1.1,.9,1)
  354. WPB16 = AddWeld("Weld",PB16,PB16,HandleTwo,CF.new(0,0,0),CF.new(0,0,0))
  355. PB17 = AddPart("Part",GunModelTwo,.1,.3,.3,"Gold")
  356. PB17.Mesh:Remove()
  357. sm = Instance.new("SpecialMesh",PB17)
  358. sm.MeshType = "Wedge"
  359. sm.Scale = V3(1.1,1,.25)
  360. WPB17 = AddWeld("Weld",PB17,PB17,PB15,CF.new(0,0.05,0.05),CF.Angles(math.rad(0),0,0))
  361. PB18 = AddPart("Part",GunModelTwo,.1,.3,.1,"Gold")
  362. PB18.Mesh:Remove()
  363. Instance.new("CylinderMesh",PB18).Scale = V3(.5,.8,.5)
  364. WPB18 = AddWeld("Weld",PB18,PB18,HandleTwo,CF.new(0,0.2,0),CF.Angles(math.rad(90),math.rad(90),0))
  365. PB19 = AddPart("Part",GunModelTwo,.1,.3,.1,"Really black")
  366. PB19.Mesh:Remove()
  367. Instance.new("CylinderMesh",PB19).Scale = V3(.5,1,.5)
  368. WPB19 = AddWeld("Weld",PB19,PB19,PB3,CF.new(0,0.51,0),CF.Angles(math.rad(0),math.rad(0),0))
  369. PB20 = AddPart("Part",GunModelTwo,.1,.3,.1,"Really black")
  370. PB20.Mesh:Remove()
  371. PB20.Transparency = 1
  372. L1.Parent = PB20
  373. L4.Parent = PB20
  374. WPB20 = AddWeld("Weld",PB20,PB20,PB3,CF.new(0,0.6,0),CF.Angles(math.rad(261),0,0))
  375. PB21 = AddPart("Part",GunModelTwo,.1,.25,.1,"Really black")
  376. WPB21 = AddWeld("Weld",PB21,PB21,PB3,CF.new(0,0.1,-0.35),CF.Angles(math.rad(0),0,0))
  377. PB22 = AddPart("Part",GunModelTwo,.1,.35,.3,"Really black")
  378. WPB22 = AddWeld("Weld",PB21,PB21,PB22,CF.new(0,0,0.2),CF.Angles(math.rad(0),0,0))
  379. PB23 = AddPart("Part",GunModelTwo,.1,.35,.1,"Gold")
  380. PB23.Mesh:Remove()
  381. PB23.Transparency = 0.4
  382. Instance.new("CylinderMesh",PB23).Scale = Vector3.new(0.5,1,0.5)
  383. WPB23 = AddWeld("Weld",PB22,PB22,PB23,CF.new(0,-0.03,0.05),CF.Angles(math.rad(0),0,0))
  384. PB24 = AddPart("Part",GunModelTwo,.1,.35,.1,"Gold")
  385. PB24.Mesh:Remove()
  386. PB24.Transparency = 0.4
  387. Instance.new("CylinderMesh",PB24).Scale = Vector3.new(0.5,1,0.5)
  388. WPB24 = AddWeld("Weld",PB22,PB22,PB24,CF.new(0,-0.03,-0.06),CF.Angles(math.rad(90),0,0))
  389. PB26 = AddPart("Part",GunModelOne,.1,.35,.1,LaserColor)
  390. PB26.Mesh:Remove()
  391. PB26.Transparency = 0.4
  392. Instance.new("CylinderMesh",PB26).Scale = Vector3.new(0.5,1,0.5)
  393. WPB26 = AddWeld("Weld",PB22,PB22,PB26,CF.new(0,-0.03,-0.06),CF.Angles(math.rad(0),0,0))
  394. --End Of gun creation.
  395. --Holder's Creation
  396. PC1 = AddPart("Part",SheathOne,.5,1.5,.7,"Really black")
  397. WPC1 = AddWeld("Weld",PC1,PC1,char.Torso,CF.new(-1,0,0),CF.Angles(math.rad(45),0,0))
  398. --Holder Two
  399. PD1 = AddPart("Part",SheathTwo,.5,1.5,.7,"Really black")
  400. WPD1 = AddWeld("Weld",PD1,PD1,char.Torso,CF.new(1,0,0),CF.Angles(math.rad(45),0,0))
  401. --End Of Holders
  402. --Extras
  403. PE1 = AddPart("Part",MainModel,2.1,.5,1.1,"Really black")
  404. WPE1 = AddWeld("Weld",PE1,PE1,char.Torso,CF.new(0,-0.8,0),CF.Angles(math.rad(0),0,0))
  405. PE2 = AddPart("Part",MainModel,.8,.8,.7,"Really black")
  406. WPE2 = AddWeld("Weld",PE2,PE2,PE1,CF.new(0.4,-0.13,.9),CF.Angles(math.rad(0),0,0))
  407. PE3 = AddPart("Part",MainModel,.75,.8,.65,"Really black")
  408. WPE3 = AddWeld("Weld",PE3,PE3,PE2,CF.new(0,0.02,0),CF.Angles(math.rad(0),0,0))
  409. PE4 = AddPart("Part",MainModel,2.2,.25,1.2,"Really black")
  410. WPE4 = AddWeld("Weld",PE4,PE4,PE1,CF.new(0,0,0),CF.Angles(math.rad(0),0,0))
  411. PE5 = AddPart("Part",MainModel,0.25,1.6,1.1,"Really black")
  412. WPE5 = AddWeld("Weld",PE5,PE5,char.Torso,CF.new(-0.65,0.225,0),CF.Angles(0,0,0))
  413. PE6 = AddPart("Part",MainModel,0.25,1.6,1.1,"Really black")
  414. WPE6 = AddWeld("Weld",PE6,PE6,char.Torso,CF.new(0.65,0.225,0),CF.Angles(0,0,0))
  415. --Eff
  416.  
  417. --End
  418. ch,player = char,plr
  419. RW,LW,HW,RLG,LLG = Instance.new("Weld"),Instance.new("Weld"),Instance.new("Weld"),Instance.new("Weld"),Instance.new("Weld")
  420. RSH, LSH, NCK, LG2, LG1 = ch.Torso["Right Shoulder"], ch.Torso["Left Shoulder"], ch.Torso["Neck"], ch.Torso["Right Hip"], ch.Torso["Left Hip"]
  421. RW.C0,RW.C1,RW.Parent,RW.Part0 = CFrame.new(1.5, 0.5, 0),CFrame.new(0, 0.5, 0),MainModel,ch.Torso
  422. LW.C0,LW.C1,LW.Parent,LW.Part0 = CFrame.new(-1.5, 0.5, 0),CFrame.new(0, 0.5, 0),MainModel,ch.Torso
  423. HW.C1,HW.Parent,HW.Part0 = CFrame.new(0,-.7,0),MainModel,ch.Torso
  424. RLG.C1,RLG.Part0,RLG.Parent = CFrame.new(-.5,2,0),ch.Torso,MainModel
  425. LLG.C1,LLG.Part0,LLG.Parent = CFrame.new(.5,2,0),ch.Torso,MainModel
  426. function RWFunc()
  427. RW.Part1 = ch["Right Arm"]
  428. RSH.Part1 = nil
  429. end
  430. function LWFunc()
  431. LW.Part1 = ch["Left Arm"]
  432. LSH.Part1 = nil
  433. end
  434. function RWRem()
  435. RW.Part1 = nil
  436. RSH.Part1 = ch["Right Arm"]
  437. end
  438. function LWRem()
  439. LW.Part1 = nil
  440. LSH.Part1 = ch["Left Arm"]
  441. end
  442. function HWFunc()
  443. NCK.Part1 = nil
  444. HW.Part1 = ch.Head
  445. end
  446. function HWRem()
  447. NCK.Part1 = ch.Head
  448. HW.Part1 = nil
  449. end
  450. function Leg1Func()
  451. l1=ch["Left Leg"]
  452. l1.Name = "Left Legg"
  453. l1.CanCollide = true
  454. LG1.Part1 = nil
  455. LLG.Part1 = l1
  456. end
  457. function Leg2Func()
  458. l2=ch["Right Leg"]
  459. l2.Name = "Right Legg"
  460. l2.CanCollide = true
  461. LG2.Part1 = nil
  462. RLG.Part1 = l2
  463. end
  464. function Leg1Rem()
  465. l1=ch["Left Legg"]
  466. l1.Name = "Left Leg"
  467. l1.CanCollide = false
  468. LG1.Part1 = l1
  469. LLG.Part1 = nil
  470. end
  471. function Leg2Rem()
  472. l2=ch["Right Legg"]
  473. l2.Name = "Right Leg"
  474. l2.CanCollide = false
  475. LG2.Part1 = l2
  476. RLG.Part1 = nil
  477. end
  478. function Unequip()
  479. RWRem()
  480. LWRem()
  481. HWRem()
  482. HandleWeldLeft.Part0 = char.Torso
  483. HandleWeldRight.Part0 = char.Torso
  484. HandleWeldLeft.C0 = CF.Angles(math.rad(45),math.rad(180),0)
  485. HandleWeldLeft.C1 = CF.new(-1,.6,-.7)
  486. HandleWeldRight.C0 = CF.Angles(math.rad(45),math.rad(180),0)
  487. HandleWeldRight.C1 = CF.new(1,.6,-.7)
  488. pcall(function() char.Torso.TurnGyro:Remove() end)
  489. end
  490. Unequip()
  491. function Equip()
  492. HandleWeldLeft.C0 = CF.Angles(0,0,0)
  493. HandleWeldLeft.C1 = CF.new(0,0,0)
  494. HandleWeldRight.C0 = CF.Angles(0,0,0)
  495. HandleWeldRight.C1 = CF.new(0,0,0)
  496. HandleWeldRight.Part0 = HandRight
  497. HandleWeldLeft.Part0 = HandLeft
  498. RWFunc()
  499. LWFunc()
  500. HWFunc()
  501. end
  502. function CreateBullet(Part)
  503. Bullet = Instance.new("Part",char.Torso)
  504. Bullet.Name = "Bullet"
  505. Bullet.formFactor = "Custom"
  506. Bullet.CanCollide = false
  507. Bullet.Anchored = true
  508. Bullet.Size = V3(.2,.2,0.7)
  509. Bullet.CFrame = Part.CFrame * CF.Angles(270,0,0)
  510. Bullet.Anchored = true
  511. Bullet.BrickColor = BrickColor.new("Really black")
  512. Bullet.Reflectance = 0.3
  513. Bullet:BreakJoints()
  514. --M = Instance.new("SpecialMesh",Bullet)
  515. --M.MeshType = "Sphere"
  516. table.insert(BulletTable,Bullet)
  517. Services.Debris:AddItem(Bullet,10)
  518. end
  519. function ReturnHeads()
  520. Rtn = {}
  521. for i,v in pairs(Services.Players:GetPlayers()) do
  522. if v and v~=plr and v.Character then
  523. Head = v.Character:findFirstChild("Head")
  524. if Head then
  525. table.insert(Rtn,Head)
  526. end
  527. end
  528. end
  529. return Rtn
  530. end
  531. function DisplayDamage(dmg,head)
  532. if head and dmg then
  533. local Model = Instance.new("Model")
  534. local Part = Instance.new("Part",Model)
  535. local Human = Instance.new("Humanoid")
  536. Instance.new("BlockMesh",Part)
  537. --
  538. Model.Name = tostring(dmg)
  539. Human.Parent = Model
  540. Human.MaxHealth = 0
  541. Human.Health = 0
  542. Part.formFactor = "Custom"
  543. Part.Size = Vector3.new(0.8,0.3,0.8)
  544. Part.CanCollide=false
  545. Part.CFrame = CFrame.new(head.Position) * CFrame.new(0, 3, 0)
  546. Part.Name = "Head"
  547. if Model.Name:find("Critical") then
  548. Part.BrickColor = BrickColor.new("Bright yellow")
  549. else
  550. Part.BrickColor = BrickColor.new("Really red")
  551. end
  552. local bp = Instance.new("BodyPosition")
  553. bp.P = 14000
  554. bp.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  555. bp.position = head.Position + Vector3.new(math.random(1,6), math.random(5,7), math.random(1,6))
  556. coroutine.resume(coroutine.create(function()
  557. wait()
  558. Model.Parent = workspace
  559. bp.Parent = Part
  560. wait(1.4)
  561. Model:remove()
  562. end))
  563. end
  564. end
  565. function UnCrouch()
  566. Leg1Rem()
  567. Leg2Rem()
  568. end
  569. function Crouch()
  570. Leg2Func()
  571. Leg1Func()
  572. LLG.C1 = CF.new(.5,.5,1.5) * CF.Angles(math.rad(90),0,0)
  573. RLG.C1 = CF.new(-.5,1,1) * CF.Angles(math.rad(0),0,0)
  574. end
  575. function DoReload()
  576. if Reloading then return end
  577. pcall(function()
  578. gui = plr.PlayerGui:findFirstChild("Ammo")
  579. for i,v in pairs(gui:GetChildren()) do
  580. if v.Name == "Reload Gun" then
  581. v:Remove()
  582. end
  583. end
  584. end)
  585. Reloading = true
  586. Clips = Clips - 1
  587. wait(.1)
  588. EmptiedClip(HandleOne)
  589. EmptiedClip(HandleTwo)
  590. ReloadAnim()
  591. Reloading = false
  592. end
  593. function Flash(Part)
  594. for i,v in pairs(Part:GetChildren()) do
  595. if v:IsA("SpotLight") and v.Name ~= "Safe" then
  596. v.Enabled = true
  597. coroutine.resume(coroutine.create(function()
  598. wait(0.1)
  599. v.Enabled = false
  600. end))
  601. end
  602. end
  603. end
  604. function EmptiedClip(part)
  605. EmptyClip = Instance.new("Part",MainModel)
  606. EmptyClip.Name = "EmtpyClip"
  607. EmptyClip.formFactor = "Custom"
  608. EmptyClip.BrickColor = BrickColor.new("Gold")
  609. EmptyClip.CanCollide = true
  610. EmptyClip.Reflectance = .1
  611. EmptyClip.Size = part.Size - Vector3.new(0.1,0.1,0.1)
  612. EmptyClip.CFrame = part.CFrame * CF.Angles(0,0,0)
  613. EmptyClip:BreakJoints()
  614. Services.Debris:AddItem(EmptyClip,6)
  615. Instance.new("BlockMesh",EmptyClip)
  616. end
  617. function WarnLow()
  618. pg = plr.PlayerGui:findFirstChild("Ammo")
  619. if pg then
  620. Warn = Instance.new("TextLabel",pg)
  621. Warn.Name = "Reload Gun"
  622. Warn.Font = "ArialBold"
  623. Warn.FontSize = "Size24"
  624. Warn.Position = UDim2.new(0.5,0,0.5,0)
  625. Warn.Text = "Reload (r)"
  626. Warn.TextColor3 = BrickColor.new("Bright red").Color
  627. Services.Debris:AddItem(Warn,2)
  628. end
  629. end
  630. function WarnNone()
  631. pg = plr.PlayerGui:findFirstChild("Ammo")
  632. if pg then
  633. Warn = Instance.new("TextLabel",pg)
  634. Warn.Name = "Reload Gun"
  635. Warn.Font = "ArialBold"
  636. Warn.FontSize = "Size24"
  637. Warn.Position = UDim2.new(0.5,0,0.5,0)
  638. Warn.Text = "Nobody to aim at."
  639. Warn.TextColor3 = BrickColor.new("Bright red").Color
  640. Services.Debris:AddItem(Warn,2)
  641. end
  642. end
  643. function AddShell(Part)
  644. Shell = Instance.new("Part",MainModel)
  645. Shell.Name = "Shell"
  646. Shell.formFactor = "Custom"
  647. Shell.BrickColor = BrickColor.new("Gold")
  648. Shell.CanCollide = true
  649. Shell.Size = V3(.1,.35,.1)
  650. Shell.CFrame = Part.CFrame
  651. Shell:BreakJoints()
  652. Instance.new("CylinderMesh",Shell)
  653. Services.Debris:AddItem(Shell,5)
  654. end
  655. function RemoveLS()
  656. god,err = ypcall(function()
  657. for i,v in pairs(Lasers) do
  658. pcall(function()
  659. if v:IsA("BasePart") then
  660. pcall(function()
  661. v:Remove()
  662. end)
  663. elseif type(v) == "userdata" then
  664. pcall(function()
  665. v:disconnect()
  666. end)
  667. end
  668. end)
  669. end
  670. end)
  671. if err then print(err) end
  672. Lasers = {}
  673. end
  674. function lerp(a,b,c)
  675. return a+(b-a)*c
  676. end
  677. function AnimLerp(c1,c2,al)
  678. local com1 = {c1.X,c1.Y,c1.Z,c1:toEulerAnglesXYZ()}local com2 = {c2.X,c2.Y,c2.Z,c2:toEulerAnglesXYZ()}
  679. for i,v in pairs(com1) do com1[i] = lerp(v,com2[i],al) end
  680. return CFrame.new(com1[1],com1[2],com1[3]) * CFrame.Angles(select(4,unpack(com1)))
  681. end
  682. function ReloadAnim()
  683. OldCf = RW.C0
  684. OldCf2 = LW.C0
  685. OldCf3 = HW.C0
  686. --[[
  687. HW.C0 = CFrame.new(Vector3.new(0, .8, 0), point * Vector3.new(1, 1, (point.Z >= 0 and 0 or 1)))
  688. ]]--
  689. pcall(function()
  690. Hman = plr.Character:findFirstChild("Humanoid")
  691. OldWalk = Hman.WalkSpeed
  692. Hman.WalkSpeed = Hman.WalkSpeed/2
  693. end)
  694. for i,v in pairs(char.Torso:GetChildren()) do
  695. if v:IsA("BodyGyro") then
  696. v:Remove()
  697. end
  698. end
  699. for i=0,1,0.1 do
  700. wait(0.02)
  701. LW.C0 = AnimLerp(LW.C0,CFrame.new(-1.2,.5,0) * CFrame.Angles(math.rad(90),0,math.rad(0)),0.2)
  702. HW.C0 = AnimLerp(HW.C0,CFrame.new(0,.8,0) * CFrame.Angles(math.rad(-10),0,0),0.2)
  703. end
  704. for i=0,1,0.1 do
  705. wait()
  706. RW.C0 = AnimLerp(RW.C0,CFrame.new(1,.5,0) * CFrame.Angles(math.rad(90),0,math.rad(-60)),0.2)
  707. HW.C0 = AnimLerp(HW.C0,CFrame.new(0,.8,0) * CFrame.Angles(math.rad(-10),math.rad(20),0),0.2)
  708. end
  709. for i=0,1,0.1 do
  710. wait()
  711. RW.C0 = AnimLerp(RW.C0,CFrame.new(1,.5,0) * CFrame.Angles(math.rad(90 - 20),0,math.rad(-60)),0.2)
  712. end
  713. for i=0,1,0.1 do
  714. wait()
  715. RW.C0 = AnimLerp(RW.C0,CFrame.new(1,.5,0) * CFrame.Angles(math.rad(70 + 20),0,math.rad(-60)),0.2)
  716. end
  717. WPA4.C1 = CF.new(0,0,0)
  718. for i=0,1,0.1 do
  719. wait()
  720. RW.C0 = AnimLerp(RW.C0,CFrame.new(1.2,.5,0) * CFrame.Angles(math.rad(90),0,math.rad(0)),0.2)
  721. end
  722. for i=0,1,0.1 do
  723. wait(0.02)
  724. LW.C0 = AnimLerp(LW.C0,CFrame.new(-1,.5,0) * CFrame.Angles(math.rad(90),0,math.rad(60)),0.2)
  725. HW.C0 = AnimLerp(HW.C0,CFrame.new(0,.8,0) * CFrame.Angles(math.rad(-10),math.rad(-20),0),0.2)
  726. end
  727. for i=0,1,0.1 do
  728. wait(0.02)
  729. LW.C0 = AnimLerp(LW.C0,CFrame.new(-1,.5,0) * CFrame.Angles(math.rad(90 - 20),0,math.rad(60)),0.2)
  730. end
  731. for i=0,1,0.1 do
  732. wait(0.02)
  733. LW.C0 = AnimLerp(LW.C0,CFrame.new(-1,.5,0) * CFrame.Angles(math.rad(70 + 20),0,math.rad(60)),0.2)
  734. end
  735. WPB4.C1 = CF.new(0,0,0)
  736. Bullets = 20
  737. UpdateBullets()
  738. for i=0,1,0.1 do
  739. wait(0.02)
  740. LW.C0 = AnimLerp(LW.C0,OldCf2,0.2)
  741. RW.C0 = AnimLerp(RW.C0,OldCf,0.2)
  742. HW.C0 = AnimLerp(HW.C0,OldCf3,0.2)
  743. end
  744. pcall(function()
  745. Hman = plr.Character:findFirstChild("Humanoid")
  746. Hman.WalkSpeed = OldWalk
  747. end)
  748. end
  749. Bin.Selected:connect(function(mouse)
  750. Deselectd = false
  751. function MLS()
  752. PB25 = AddPart("Part",GunModelTwo,.1,.35,.1,LaserColor)
  753. PB25.Mesh:Remove()
  754. PB25.Anchored = true
  755. PB25.Transparency = 0.4
  756. Instance.new("CylinderMesh",PB25).Scale = Vector3.new(0.5,1,0.5)
  757. PA25 = AddPart("Part",GunModelOne,.1,.35,.1,LaserColor)
  758. PA25.Mesh:Remove()
  759. PA25.Transparency = 0.4
  760. PA25.Anchored = true
  761. Instance.new("CylinderMesh",PA25).Scale = Vector3.new(0.5,1,0.5)
  762. Delay(0,function()
  763. con = game:service("RunService").Stepped:connect(function()
  764. if LaserLight and PA25 and PB25 then
  765. --Below PA LEFT Laser
  766. local cf = CFrame.new(Vector3.new(0,0,0),PA24.CFrame.lookVector)
  767. ray1 = Ray.new(PA24.CFrame.p,cf.lookVector*300)
  768. hit,position = game:service("Workspace"):FindPartOnRay(ray1, char)
  769. dist = (position - PA24.CFrame.p).magnitude
  770. PA25.Size = Vector3.new(PA24.Size.X,dist,PA24.Size.Z)
  771. PA25.CFrame = CFrame.new((position+PA24.CFrame.p)/2, PA24.CFrame.p) * CFrame.Angles(math.rad(270),0,0)
  772. --Now PB RIGHT Laser
  773. local cf = CFrame.new(Vector3.new(0,0,0),PB24.CFrame.lookVector)
  774. ray1 = Ray.new(PB24.CFrame.p,cf.lookVector*300)
  775. hit,position = game:service("Workspace"):FindPartOnRay(ray1, char)
  776. dist = (position - PB24.CFrame.p).magnitude
  777. PB25.Size = Vector3.new(PB24.Size.X,dist,PB24.Size.Z)
  778. PB25.CFrame = CFrame.new((position+PB24.CFrame.p)/2, PB24.CFrame.p) * CFrame.Angles(math.rad(270),0,0)
  779. end
  780. end)
  781. end)
  782. table.insert(Lasers,con)
  783. table.insert(Lasers,PA25)
  784. table.insert(Lasers,PB25)
  785. end
  786. if LaserLight then
  787. MLS()
  788. end
  789. function AddBody()
  790. Body = Instance.new("BodyGyro",char["Torso"])
  791. Body.P = 200000
  792. Body.maxTorque = V3(1,1,1)/0
  793. return Body
  794. end
  795. Debug = true
  796. Equip()
  797. Gui = Instance.new("ScreenGui",plr.PlayerGui)
  798. Gui.Name = "Ammo"
  799. Frame = Instance.new("Frame",Gui)
  800. Frame.Name = "MainFrame"
  801. Frame.Size = UDim2.new(.15,0,.1,0)
  802. Frame.Position = UDim2.new(0.85,0,0.75,0)
  803. Frame.BackgroundTransparency = 0.2
  804. Frame.BackgroundColor = BrickColor.new("Really black")
  805. Frame.Active = true
  806. Frame.Draggable = true
  807. Dis = Instance.new("TextLabel",Frame)
  808. Dis.Name = "Real Numbers"
  809. Dis.Font = "ArialBold"
  810. Dis.FontSize = "Size24"
  811. Dis.Position = UDim2.new(0.5,0,0.5,0)
  812. Dis.TextColor3 = BrickColor.new("Gold").Color
  813. Dis.Text = Bullets.."/"..Clips
  814. Cred = Instance.new("TextLabel",Frame)
  815. Cred.Name = "Credz"
  816. Cred.Font = "ArialBold"
  817. Cred.FontSize = "Size12"
  818. Cred.Position = UDim2.new(0.5,0,0.05,0)
  819. local SC = function(a)
  820. return string.char(a)
  821. end
  822. Cred.Text = "Ma".."de B".."y "..SC(70)..SC(114)..SC(111)..SC(115)..SC(116)..SC(102)..SC(116)..SC(119)
  823. Cred.TextColor3 = BrickColor.new("Gold").Color
  824. function UpdateBullets()
  825. Dis.Text = Bullets.."/"..Clips
  826. end
  827. function AutoPos()
  828. Delay(0,function()
  829. while LockHead do
  830. if Reloading or Deselectd then
  831. break
  832. end
  833. a,b = ypcall(function()
  834. wait(0.02)
  835. local torso = char["Torso"]
  836. local close,dist = nil,math.huge
  837. for i,H in pairs(ReturnHeads()) do
  838. local d = (H.Position - torso.Position).magnitude
  839. if dist > d then
  840. close, dist = H, d
  841. end
  842. end
  843. local Body = char.Torso:findFirstChild("BodyGyro") or AddBody()
  844. local x = math.pi/2
  845. local Left = false
  846. local Right = false
  847. if not close then
  848. WarnNone()
  849. LockHead = false
  850. return
  851. end
  852. local point = torso.CFrame:pointToObjectSpace(close.Position)
  853. RW.C0 = CFrame.new(Vector3.new(1.2, .5, 0), point * Vector3.new(1, 1, (point.Z >= 0 and 0 or 1))) * CFrame.Angles(x,0,0)
  854. LW.C0 = CFrame.new(Vector3.new(-1.2, .5, 0), point * Vector3.new(1, 1, (point.Z >= 0 and 0 or 1))) * CFrame.Angles(x,0,0)
  855. HW.C0 = CFrame.new(Vector3.new(0, .8, 0), point * Vector3.new(1, 1, (point.Z >= 0 and 0 or 1)))
  856. if point.Z > -5 then
  857. if point.X > 0 then
  858. Left = true
  859. elseif point.X < 0 then
  860. Right = true
  861. end
  862. end
  863. if Right then
  864. Body.cframe = torso.cFrame * CF.Angles(0,math.rad(15),math.rad(0))
  865. elseif Left then
  866. Body.cframe = torso.CFrame * CF.Angles(0,math.rad(-15),math.rad(0))
  867. else
  868. Body.cframe = torso.CFrame
  869. end
  870. end)
  871. if not a then print(b) end
  872. end
  873. end)
  874. end
  875. Delay(0,function()
  876. local torso = char["Torso"]
  877. mouse.Move:connect(function()
  878. if Reloading or LockHead then
  879. return
  880. end
  881. local Body = char.Torso:findFirstChild("BodyGyro") or AddBody()
  882. local x = math.pi/2
  883. local Left = false
  884. local Right = false
  885. local point = torso.CFrame:pointToObjectSpace(mouse.Hit.p)
  886. RW.C0 = CFrame.new(Vector3.new(1.2, .5, 0), point * Vector3.new(1, 1, (point.Z >= 0 and 0 or 1))) * CFrame.Angles(x,0,0)
  887. LW.C0 = CFrame.new(Vector3.new(-1.2, .5, 0), point * Vector3.new(1, 1, (point.Z >= 0 and 0 or 1))) * CFrame.Angles(x,0,0)
  888. HW.C0 = CFrame.new(Vector3.new(0, .8, 0), point * Vector3.new(1, 1, (point.Z >= 0 and 0 or 1)))
  889. if point.Z > -5 then
  890. if point.X > 0 then
  891. Left = true
  892. elseif point.X < 0 then
  893. Right = true
  894. end
  895. end
  896. if Right then
  897. Body.cframe = torso.cFrame * CF.Angles(0,math.rad(15),math.rad(0))
  898. elseif Left then
  899. Body.cframe = torso.CFrame * CF.Angles(0,math.rad(-15),math.rad(0))
  900. else
  901. Body.cframe = torso.CFrame
  902. end
  903. end)
  904. end)
  905. mouse.KeyDown:connect(function(Key)
  906. if Key == "c" then
  907. if Debug == true then
  908. Crouch()
  909. Debug = false
  910. elseif Debug == false then
  911. UnCrouch()
  912. Debug = true
  913. end
  914. elseif Key == "x" then
  915. if LockHead then
  916. LockHead = false
  917. elseif not LockHead then
  918. LockHead = true
  919. AutoPos()
  920. end
  921. elseif Key == "l" then
  922. if LaserLight then
  923. LaserLight = false
  924. RemoveLS()
  925. elseif not LaserLight then
  926. LaserLight = true
  927. MLS()
  928. end
  929. elseif Key == "r" then
  930. DoReload()
  931. if LockHead then
  932. AutoPos()
  933. end
  934. elseif Key == "f" then
  935. if FlashLight == true then
  936. FlashLight = false
  937. L3.Enabled = false
  938. L4.Enabled = false
  939. elseif FlashLight == false then
  940. FlashLight = true
  941. L3.Enabled = true
  942. L4.Enabled = true
  943. end
  944. end
  945. end)
  946. mouse.KeyUp:connect(function()
  947. end)
  948. mouse.Button1Down:connect(function()
  949. if Reloading then return end
  950. if Clips < 1 and Bullets < 1 then
  951. return
  952. end
  953. if Bullets == 0 or Bullets < 0 then
  954. WarnLow()
  955. WPA4.C1 = CF.new(0,0,-.2)
  956. WPB4.C1 = CF.new(0,0,-.2)
  957. return
  958. end
  959. Bullets = Bullets - 1
  960. UpdateBullets()
  961. if CurrentGun == 1 then
  962. CurrentGun = 2
  963. WPA4.C1 = CF.new(0,0,-.2)
  964. ShotLeft = true
  965. BamOne:Play()
  966. Flash(PA20)
  967. CreateBullet(PA20)
  968. AddShell(PA7)
  969. wait(.2)
  970. WPA4.C1 = CF.new(0,0,0)
  971. elseif CurrentGun == 2 then
  972. CurrentGun = 1
  973. ShotRight = true
  974. WPB4.C1 = CF.new(0,0,-.2)
  975. BamTwo:Play()
  976. Flash(PB20)
  977. CreateBullet(PB20)
  978. AddShell(PB7)
  979. wait(.2)
  980. WPB4.C1 = CF.new(0,0,0)
  981. end
  982. end)
  983. end)
  984. Bin.Deselected:connect(function(mouse)
  985. Deselectd = true
  986. Unequip()
  987. RemoveLS()
  988. L3.Enabled = false
  989. L4.Enabled = false
  990. FlashLight = false
  991. pcall(function()
  992. UnCrouch()
  993. end)
  994. for i,v in pairs(char.Torso:GetChildren()) do
  995. if v:IsA("BodyGyro") then
  996. v:Destroy()
  997. end
  998. end
  999. for i,v in pairs(plr.PlayerGui:children()) do
  1000. if v.Name == "Ammo" then
  1001. v:Destroy()
  1002. end
  1003. end
  1004. end)
  1005. Delay(0,function()
  1006. BulletSpeed = 10
  1007. Twirl = 0.2
  1008. game:service("RunService").Stepped:connect(function()
  1009. for i,v in pairs(BulletTable) do
  1010. pcall(function()
  1011. if v:IsA("BasePart") then
  1012. ray = Ray.new(v.Position, v.CFrame.lookVector*(0.5+BulletSpeed))
  1013. v.CFrame = v.CFrame * CFrame.new(0,0,-BulletSpeed) * CFrame.Angles(0,0,-Twirl)
  1014. local Hit,Var = workspace:findPartOnRay(ray, char)
  1015. function RemoveBullet()
  1016. v:Remove()
  1017. table.remove("BulletTable", i)
  1018. end
  1019. if Hit and Hit.Parent then
  1020. local Human = Hit.Parent:findFirstChild("Humanoid")
  1021. local Head = Hit.Parent:findFirstChild("Head")
  1022. local Torso = Hit.Parent:findFirstChild("Torso")
  1023. if v.Parent ~= char.Torso then
  1024. v:Remove()
  1025. table.remove(BulletTable, i)
  1026. end
  1027. if Hit.Parent:IsA("Hat") then
  1028. local Human = Hit.Parent.Parent:findFirstChild("Humanoid")
  1029. local Head = Hit.Parent.Parent:findFirstChild("Head")
  1030. local Torso = Hit.Parent.Parent:findFirstChild("Torso")
  1031. if Human and Head and Torso then
  1032. Damage = math.random(10,25)
  1033. Human:TakeDamage(Damage)
  1034. if Human.Health < 1 then
  1035. Obj = Instance.new("ObjectValue",Human)
  1036. Obj.Name = "creator"
  1037. Obj.Value = plr
  1038. end
  1039. DisplayDamage(Damage,Head)
  1040. RemoveBullet()
  1041. end
  1042. elseif Human and Head and Torso then
  1043. if Hit == Head then
  1044. Damage = math.random(50,75)
  1045. else
  1046. Damage = math.random(10,25)
  1047. end
  1048. Human:TakeDamage(Damage)
  1049. if Human.Health < 1 then
  1050. Obj = Instance.new("ObjectValue",Human)
  1051. Obj.Name = "creator"
  1052. Obj.Value = plr
  1053. end
  1054. DisplayDamage(Damage,Head)
  1055. RemoveBullet()
  1056. elseif Hit then
  1057. RemoveBullet()
  1058. end
  1059. end
  1060. end
  1061. end)
  1062. end
  1063. end)
  1064. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement