Advertisement
waconline

dual pistols??

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