Advertisement
Scripteditor233

gun 2

Oct 20th, 2018
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.71 KB | None | 0 0
  1. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  2. local Player,game,owner = owner,game
  3. local RealPlayer = Player
  4. do
  5. print("FE Compatibility code by Mokiros")
  6. local rp = RealPlayer
  7. script.Parent = rp.Character
  8.  
  9. --RemoteEvent for communicating
  10. local Event = Instance.new("RemoteEvent")
  11. Event.Name = "UserInput_Event"
  12.  
  13. --Fake event to make stuff like Mouse.KeyDown work
  14. local function fakeEvent()
  15. local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
  16. t.connect = t.Connect
  17. return t
  18. end
  19.  
  20. --Creating fake input objects with fake variables
  21. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  22. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  23. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  24. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  25. end}
  26. --Merged 2 functions into one by checking amount of arguments
  27. CAS.UnbindAction = CAS.BindAction
  28.  
  29. --This function will trigger the events that have been :Connect()'ed
  30. local function te(self,ev,...)
  31. local t = m[ev]
  32. if t and t._fakeEvent then
  33. for _,f in pairs(t.Functions) do
  34. f(...)
  35. end
  36. end
  37. end
  38. m.TrigEvent = te
  39. UIS.TrigEvent = te
  40.  
  41. Event.OnServerEvent:Connect(function(plr,io)
  42. if plr~=rp then return end
  43. m.Target = io.Target
  44. m.Hit = io.Hit
  45. if not io.isMouse then
  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. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  51. return m:TrigEvent(b and "Button2Down" or "Button2Up")
  52. end
  53. for _,t in pairs(CAS.Actions) do
  54. for _,k in pairs(t.Keys) do
  55. if k==io.KeyCode then
  56. t.Function(t.Name,io.UserInputState,io)
  57. end
  58. end
  59. end
  60. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  61. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  62. end
  63. end)
  64. Event.Parent = NLS([==[
  65. local Player = game:GetService("Players").LocalPlayer
  66. local Event = script:WaitForChild("UserInput_Event")
  67.  
  68. local Mouse = Player:GetMouse()
  69. local UIS = game:GetService("UserInputService")
  70. local input = function(io,a)
  71. if a then return end
  72. --Since InputObject is a client-side instance, we create and pass table instead
  73. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  74. end
  75. UIS.InputBegan:Connect(input)
  76. UIS.InputEnded:Connect(input)
  77.  
  78. local h,t
  79. --Give the server mouse data 30 times every second, but only if the values changed
  80. --If player is not moving their mouse, client won't fire events
  81. while wait(1/30) do
  82. if h~=Mouse.Hit or t~=Mouse.Target then
  83. h,t=Mouse.Hit,Mouse.Target
  84. Event:FireServer({isMouse=true,Target=t,Hit=h})
  85. end
  86. end]==],Player.Character)
  87.  
  88. ----Sandboxed game object that allows the usage of client-side methods and services
  89. --Real game object
  90. local _rg = game
  91.  
  92. --Metatable for fake service
  93. local fsmt = {
  94. __index = function(self,k)
  95. local s = rawget(self,"_RealService")
  96. if s then
  97. return typeof(s[k])=="function"
  98. and function(_,...)return s[k](s,...)end or s[k]
  99. end
  100. end,
  101. __newindex = function(self,k,v)
  102. local s = rawget(self,"_RealService")
  103. if s then s[k]=v end
  104. end
  105. }
  106. local function FakeService(t,RealService)
  107. t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  108. return setmetatable(t,fsmt)
  109. end
  110.  
  111. --Fake game object
  112. local g = {
  113. GetService = function(self,s)
  114. return rawget(self,s) or _rg:GetService(s)
  115. end,
  116. Players = FakeService({
  117. LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  118. },"Players"),
  119. UserInputService = FakeService(UIS,"UserInputService"),
  120. ContextActionService = FakeService(CAS,"ContextActionService"),
  121. RunService = FakeService({
  122. _btrs = {},
  123. RenderStepped = _rg:GetService("RunService").Heartbeat,
  124. BindToRenderStep = function(self,name,_,fun)
  125. self._btrs[name] = self.Heartbeat:Connect(fun)
  126. end,
  127. UnbindFromRenderStep = function(self,name)
  128. self._btrs[name]:Disconnect()
  129. end,
  130. },"RunService")
  131. }
  132. rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  133. g.service = g.GetService
  134. FakeService(g,game)
  135. --Changing owner to fake player object to support owner:GetMouse()
  136. game,owner = g,g.Players.LocalPlayer
  137. end
  138. local Scale = game.Players.LocalPlayer.Character.Torso.Size.X/2*(game.Players.LocalPlayer.Character.Torso:FindFirstChild("ScaleInserted") ~= nil and game.Players.LocalPlayer.Character.Torso:FindFirstChild("ScaleInserted").Scale.Z or 1)*0.8
  139. local Speed = 20*Scale
  140. local Gravity = 0.1
  141.  
  142. local Player = game.Players.LocalPlayer
  143. local Character = Player.Character
  144. local Humanoid = Character.Humanoid
  145. Humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll,false)
  146. local Torso = Character.HumanoidRootPart
  147. local Mouse = game.Players.LocalPlayer:GetMouse()
  148. local RenderStepped = game:GetService("RunService").RenderStepped
  149. local Camera = Workspace.CurrentCamera
  150. Camera:ClearAllChildren()
  151. local Model = Instance.new("Model",Character)
  152. local IgnoreList = {Character,Workspace.Terrain}
  153.  
  154. local Part0Joint = CFrame.new(Vector3.new(1,0.75,0)*Scale*1.25)
  155. local Part1Joint = CFrame.new(Vector3.new(-0.5,0.75,0)*Scale*1.25)
  156. local RotationOffset = CFrame.Angles(math.rad(90),math.rad(0),0)
  157. local Gangster = false
  158.  
  159. local Part0JointHead = CFrame.new(Vector3.new(0,1,0)*Scale*1.25)
  160. local Part1JointHead = CFrame.new(Vector3.new(0,-0.5,0)*Scale*1.25)
  161. local RotationOffsetHead = CFrame.Angles(0,0,0)
  162.  
  163. local Handle = Instance.new("Part",Model)
  164. Handle.CanCollide = false
  165. Handle.Name = "Handle"
  166. Handle.Position = Vector3.new(0,100,0)
  167. Handle:BreakJoints()
  168. Handle.FormFactor = "Custom"
  169. Handle.Size = Vector3.new(0.2,0.2,0.2)
  170. Handle.TopSurface = "SmoothNoOutlines"
  171. Handle.BottomSurface = "SmoothNoOutlines"
  172. Handle.FrontSurface = "SmoothNoOutlines"
  173. Handle.BackSurface = "SmoothNoOutlines"
  174. Handle.RightSurface = "SmoothNoOutlines"
  175. Handle.LeftSurface = "SmoothNoOutlines"
  176. Handle.BrickColor = BrickColor.new("Black")
  177. local Mesh = Instance.new("BlockMesh",Handle)
  178. Mesh.Scale = Vector3.new(0.25,1,0.4) / 0.2 * Scale
  179. local HandleWeld = Instance.new("Motor6D")
  180. HandleWeld.Part0 = Character["Right Arm"]
  181. HandleWeld.Part1 = Handle
  182. HandleWeld.C0 = CFrame.new(Vector3.new(0,-1,0)*Scale) * CFrame.Angles(math.rad(-105),0,0)
  183. HandleWeld.Parent = Handle
  184.  
  185. local Part = Instance.new("Part",Model)
  186. Part.CanCollide = false
  187. Part.Position = Vector3.new(0,100,0)
  188. Part:BreakJoints()
  189. Part.FormFactor = "Custom"
  190. Part.Size = Vector3.new(0.2,0.2,0.2)
  191. Part.TopSurface = "SmoothNoOutlines"
  192. Part.BottomSurface = "SmoothNoOutlines"
  193. Part.FrontSurface = "SmoothNoOutlines"
  194. Part.BackSurface = "SmoothNoOutlines"
  195. Part.RightSurface = "SmoothNoOutlines"
  196. Part.LeftSurface = "SmoothNoOutlines"
  197. Part.BrickColor = BrickColor.new("Black")
  198. local Mesh = Instance.new("CylinderMesh",Part)
  199. Mesh.Scale = Vector3.new(0.07,0.2,0.07) / 0.2 * Scale
  200. local PartWeld = Instance.new("Motor6D")
  201. PartWeld.Part0 = Handle
  202. PartWeld.Part1 = Part
  203. PartWeld.C0 = CFrame.new(Vector3.new(-0.115,-0.475,-0.190)*Scale) * CFrame.Angles(0,0,0)
  204. PartWeld.Parent = Part
  205.  
  206. local Part = Instance.new("Part",Model)
  207. Part.CanCollide = false
  208. Part.Position = Vector3.new(0,100,0)
  209. Part:BreakJoints()
  210. Part.FormFactor = "Custom"
  211. Part.Size = Vector3.new(0.2,0.2,0.2)
  212. Part.TopSurface = "SmoothNoOutlines"
  213. Part.BottomSurface = "SmoothNoOutlines"
  214. Part.FrontSurface = "SmoothNoOutlines"
  215. Part.BackSurface = "SmoothNoOutlines"
  216. Part.RightSurface = "SmoothNoOutlines"
  217. Part.LeftSurface = "SmoothNoOutlines"
  218. Part.BrickColor = BrickColor.new("Black")
  219. local Mesh = Instance.new("CylinderMesh",Part)
  220. Mesh.Scale = Vector3.new(0.07,0.2,0.07) / 0.2 * Scale
  221. local PartWeld = Instance.new("Motor6D")
  222. PartWeld.Part0 = Handle
  223. PartWeld.Part1 = Part
  224. PartWeld.C0 = CFrame.new(Vector3.new(0.115,-0.475,0.190)*Scale) * CFrame.Angles(0,0,0)
  225. PartWeld.Parent = Part
  226.  
  227. local Part = Instance.new("Part",Model)
  228. Part.CanCollide = false
  229. Part.Position = Vector3.new(0,100,0)
  230. Part:BreakJoints()
  231. Part.FormFactor = "Custom"
  232. Part.Size = Vector3.new(0.2,0.2,0.2)
  233. Part.TopSurface = "SmoothNoOutlines"
  234. Part.BottomSurface = "SmoothNoOutlines"
  235. Part.FrontSurface = "SmoothNoOutlines"
  236. Part.BackSurface = "SmoothNoOutlines"
  237. Part.RightSurface = "SmoothNoOutlines"
  238. Part.LeftSurface = "SmoothNoOutlines"
  239. Part.BrickColor = BrickColor.new("Black")
  240. local Mesh = Instance.new("CylinderMesh",Part)
  241. Mesh.Scale = Vector3.new(0.07,0.2,0.07) / 0.2 * Scale
  242. local PartWeld = Instance.new("Motor6D")
  243. PartWeld.Part0 = Handle
  244. PartWeld.Part1 = Part
  245. PartWeld.C0 = CFrame.new(Vector3.new(-0.115,-0.475,0.190)*Scale) * CFrame.Angles(0,0,0)
  246. PartWeld.Parent = Part
  247.  
  248. local Part = Instance.new("Part",Model)
  249. Part.CanCollide = false
  250. Part.Position = Vector3.new(0,100,0)
  251. Part:BreakJoints()
  252. Part.FormFactor = "Custom"
  253. Part.Size = Vector3.new(0.2,0.2,0.2)
  254. Part.TopSurface = "SmoothNoOutlines"
  255. Part.BottomSurface = "SmoothNoOutlines"
  256. Part.FrontSurface = "SmoothNoOutlines"
  257. Part.BackSurface = "SmoothNoOutlines"
  258. Part.RightSurface = "SmoothNoOutlines"
  259. Part.LeftSurface = "SmoothNoOutlines"
  260. Part.BrickColor = BrickColor.new("Black")
  261. local Mesh = Instance.new("CylinderMesh",Part)
  262. Mesh.Scale = Vector3.new(0.07,0.2,0.07) / 0.2 * Scale
  263. local PartWeld = Instance.new("Motor6D")
  264. PartWeld.Part0 = Handle
  265. PartWeld.Part1 = Part
  266. PartWeld.C0 = CFrame.new(Vector3.new(0.115,-0.475,-0.190)*Scale) * CFrame.Angles(0,0,0)
  267. PartWeld.Parent = Part
  268.  
  269. local Part = Instance.new("Part",Model)
  270. Part.CanCollide = false
  271. Part.Position = Vector3.new(0,100,0)
  272. Part:BreakJoints()
  273. Part.FormFactor = "Custom"
  274. Part.Size = Vector3.new(0.2,0.2,0.2)
  275. Part.TopSurface = "SmoothNoOutlines"
  276. Part.BottomSurface = "SmoothNoOutlines"
  277. Part.FrontSurface = "SmoothNoOutlines"
  278. Part.BackSurface = "SmoothNoOutlines"
  279. Part.RightSurface = "SmoothNoOutlines"
  280. Part.LeftSurface = "SmoothNoOutlines"
  281. Part.BrickColor = BrickColor.new("Black")
  282. local Mesh = Instance.new("BlockMesh",Part)
  283. Mesh.Scale = Vector3.new(0.23,0.2,0.1) / 0.2 * Scale
  284. local PartWeld = Instance.new("Motor6D")
  285. PartWeld.Part0 = Handle
  286. PartWeld.Part1 = Part
  287. PartWeld.C0 = CFrame.new(Vector3.new(0,-0.475,-0.175)*Scale) * CFrame.Angles(0,0,0)
  288. PartWeld.Parent = Part
  289.  
  290. local Part = Instance.new("Part",Model)
  291. Part.CanCollide = false
  292. Part.Position = Vector3.new(0,100,0)
  293. Part:BreakJoints()
  294. Part.FormFactor = "Custom"
  295. Part.Size = Vector3.new(0.2,0.2,0.2)
  296. Part.TopSurface = "SmoothNoOutlines"
  297. Part.BottomSurface = "SmoothNoOutlines"
  298. Part.FrontSurface = "SmoothNoOutlines"
  299. Part.BackSurface = "SmoothNoOutlines"
  300. Part.RightSurface = "SmoothNoOutlines"
  301. Part.LeftSurface = "SmoothNoOutlines"
  302. Part.BrickColor = BrickColor.new("Black")
  303. local Mesh = Instance.new("BlockMesh",Part)
  304. Mesh.Scale = Vector3.new(0.23,0.2,0.1) / 0.2 * Scale
  305. local PartWeld = Instance.new("Motor6D")
  306. PartWeld.Part0 = Handle
  307. PartWeld.Part1 = Part
  308. PartWeld.C0 = CFrame.new(Vector3.new(0,-0.475,0.175)*Scale) * CFrame.Angles(0,0,0)
  309. PartWeld.Parent = Part
  310.  
  311. local Part = Instance.new("Part",Model)
  312. Part.CanCollide = false
  313. Part.Position = Vector3.new(0,100,0)
  314. Part:BreakJoints()
  315. Part.FormFactor = "Custom"
  316. Part.Size = Vector3.new(0.2,0.2,0.2)
  317. Part.TopSurface = "SmoothNoOutlines"
  318. Part.BottomSurface = "SmoothNoOutlines"
  319. Part.FrontSurface = "SmoothNoOutlines"
  320. Part.BackSurface = "SmoothNoOutlines"
  321. Part.RightSurface = "SmoothNoOutlines"
  322. Part.LeftSurface = "SmoothNoOutlines"
  323. Part.BrickColor = BrickColor.new("Black")
  324. local Mesh = Instance.new("BlockMesh",Part)
  325. Mesh.Scale = Vector3.new(0.1,0.2,0.38) / 0.2 * Scale
  326. local PartWeld = Instance.new("Motor6D")
  327. PartWeld.Part0 = Handle
  328. PartWeld.Part1 = Part
  329. PartWeld.C0 = CFrame.new(Vector3.new(-0.1,-0.475,0)*Scale) * CFrame.Angles(0,0,0)
  330. PartWeld.Parent = Part
  331.  
  332. local Part = Instance.new("Part",Model)
  333. Part.CanCollide = false
  334. Part.Position = Vector3.new(0,100,0)
  335. Part:BreakJoints()
  336. Part.FormFactor = "Custom"
  337. Part.Size = Vector3.new(0.2,0.2,0.2)
  338. Part.TopSurface = "SmoothNoOutlines"
  339. Part.BottomSurface = "SmoothNoOutlines"
  340. Part.FrontSurface = "SmoothNoOutlines"
  341. Part.BackSurface = "SmoothNoOutlines"
  342. Part.RightSurface = "SmoothNoOutlines"
  343. Part.LeftSurface = "SmoothNoOutlines"
  344. Part.BrickColor = BrickColor.new("Black")
  345. local Mesh = Instance.new("BlockMesh",Part)
  346. Mesh.Scale = Vector3.new(0.1,0.2,0.38) / 0.2 * Scale
  347. local PartWeld = Instance.new("Motor6D")
  348. PartWeld.Part0 = Handle
  349. PartWeld.Part1 = Part
  350. PartWeld.C0 = CFrame.new(Vector3.new(0.1,-0.475,0)*Scale) * CFrame.Angles(0,0,0)
  351. PartWeld.Parent = Part
  352.  
  353. local Part = Instance.new("Part",Model)
  354. Part.CanCollide = false
  355. Part.Position = Vector3.new(0,100,0)
  356. Part:BreakJoints()
  357. Part.FormFactor = "Custom"
  358. Part.Size = Vector3.new(0.2,0.2,0.2)
  359. Part.TopSurface = "SmoothNoOutlines"
  360. Part.BottomSurface = "SmoothNoOutlines"
  361. Part.FrontSurface = "SmoothNoOutlines"
  362. Part.BackSurface = "SmoothNoOutlines"
  363. Part.RightSurface = "SmoothNoOutlines"
  364. Part.LeftSurface = "SmoothNoOutlines"
  365. Part.BrickColor = BrickColor.new("Black")
  366. local Mesh = Instance.new("BlockMesh",Part)
  367. Mesh.Scale = Vector3.new(0.1,0.3,0.05) / 0.2 * Scale
  368. local PartWeld = Instance.new("Motor6D")
  369. PartWeld.Part0 = Handle
  370. PartWeld.Part1 = Part
  371. PartWeld.C0 = CFrame.Angles(math.rad(15),0,0) * CFrame.new(Vector3.new(0,0.25,-0.75)*Scale) * CFrame.Angles(math.rad(-10),0,0)
  372. PartWeld.Parent = Part
  373.  
  374. local Part = Instance.new("Part",Model)
  375. Part.CanCollide = false
  376. Part.Position = Vector3.new(0,100,0)
  377. Part:BreakJoints()
  378. Part.FormFactor = "Custom"
  379. Part.Size = Vector3.new(0.2,0.2,0.2)
  380. Part.TopSurface = "SmoothNoOutlines"
  381. Part.BottomSurface = "SmoothNoOutlines"
  382. Part.FrontSurface = "SmoothNoOutlines"
  383. Part.BackSurface = "SmoothNoOutlines"
  384. Part.RightSurface = "SmoothNoOutlines"
  385. Part.LeftSurface = "SmoothNoOutlines"
  386. Part.BrickColor = BrickColor.new("Black")
  387. local Mesh = Instance.new("BlockMesh",Part)
  388. Mesh.Scale = Vector3.new(0.1,0.05,0.625) / 0.2 * Scale
  389. local PartWeld = Instance.new("Motor6D")
  390. PartWeld.Part0 = Handle
  391. PartWeld.Part1 = Part
  392. PartWeld.C0 = CFrame.Angles(math.rad(15),0,0) * CFrame.new(Vector3.new(0,0.1,-0.435)*Scale)
  393. PartWeld.Parent = Part
  394.  
  395. for i = 0,80,10 do
  396. local Part = Instance.new("Part",Model)
  397. Part.CanCollide = false
  398. Part.Position = Vector3.new(0,100,0)
  399. Part:BreakJoints()
  400. Part.FormFactor = "Custom"
  401. Part.Size = Vector3.new(0.2,0.2,0.2)
  402. Part.TopSurface = "SmoothNoOutlines"
  403. Part.BottomSurface = "SmoothNoOutlines"
  404. Part.FrontSurface = "SmoothNoOutlines"
  405. Part.BackSurface = "SmoothNoOutlines"
  406. Part.RightSurface = "SmoothNoOutlines"
  407. Part.LeftSurface = "SmoothNoOutlines"
  408. Part.BrickColor = BrickColor.new("Black")
  409. local Mesh = Instance.new("BlockMesh",Part)
  410. Mesh.Scale = Vector3.new(0.25,0.15,0.03555*2) / 0.2 * Scale
  411. local PartWeld = Instance.new("Motor6D")
  412. PartWeld.Part0 = Handle
  413. PartWeld.Part1 = Part
  414. PartWeld.C0 = CFrame.new(Vector3.new(0,0.15,0.315)*Scale) * CFrame.Angles(math.rad(i-65),0,0) * CFrame.new(Vector3.new(0,0.2,0)*Scale)
  415. PartWeld.Parent = Part
  416. end
  417.  
  418. local Barrel = Instance.new("Part",Model)
  419. Barrel.CanCollide = false
  420. Barrel.Position = Vector3.new(0,100,0)
  421. Barrel:BreakJoints()
  422. Barrel.FormFactor = "Custom"
  423. Barrel.Size = Vector3.new(0.2,0.2,0.2)
  424. Barrel.TopSurface = "SmoothNoOutlines"
  425. Barrel.BottomSurface = "SmoothNoOutlines"
  426. Barrel.FrontSurface = "SmoothNoOutlines"
  427. Barrel.BackSurface = "SmoothNoOutlines"
  428. Barrel.RightSurface = "SmoothNoOutlines"
  429. Barrel.LeftSurface = "SmoothNoOutlines"
  430. Barrel.BrickColor = BrickColor.new("Black")
  431. local Mesh = Instance.new("BlockMesh",Barrel)
  432. Mesh.Scale = Vector3.new(0.25,0.2,2) / 0.2 * Scale
  433. local BarrelWeld = Instance.new("Motor6D")
  434. BarrelWeld.Part0 = Handle
  435. BarrelWeld.Part1 = Barrel
  436. BarrelWeld.C0 = CFrame.Angles(math.rad(15),0,0) * CFrame.new(Vector3.new(0,0.5,-0.7)*Scale)
  437. BarrelWeld.Parent = Barrel
  438.  
  439. local Barrel1 = Barrel
  440.  
  441. local Barrel2 = Instance.new("Part",Model)
  442. Barrel2.CanCollide = false
  443. Barrel2.Position = Vector3.new(0,100,0)
  444. Barrel2:BreakJoints()
  445. Barrel2.FormFactor = "Custom"
  446. Barrel2.Size = Vector3.new(0.2,0.2,0.2)
  447. Barrel2.TopSurface = "SmoothNoOutlines"
  448. Barrel2.BottomSurface = "SmoothNoOutlines"
  449. Barrel2.FrontSurface = "SmoothNoOutlines"
  450. Barrel2.BackSurface = "SmoothNoOutlines"
  451. Barrel2.RightSurface = "SmoothNoOutlines"
  452. Barrel2.LeftSurface = "SmoothNoOutlines"
  453. Barrel2.BrickColor = BrickColor.new("Really black")
  454. local Mesh = Instance.new("BlockMesh",Barrel2)
  455. Mesh.Scale = Vector3.new(0.25,0.25,2) / 0.2 * Scale
  456. local Barrel2Weld = Instance.new("Motor6D")
  457. Barrel2Weld.Part0 = Barrel
  458. Barrel2Weld.Part1 = Barrel2
  459. Barrel2Weld.C0 = CFrame.new(Vector3.new(0,0.225,0)*Scale)
  460. Barrel2Weld.Parent = Barrel2
  461.  
  462. local RealBarrel = Instance.new("Part",Model)
  463. RealBarrel.CanCollide = false
  464. RealBarrel.Position = Vector3.new(0,100,0)
  465. RealBarrel:BreakJoints()
  466. RealBarrel.FormFactor = "Custom"
  467. RealBarrel.Size = Vector3.new(0.2,0.2,0.2)
  468. RealBarrel.TopSurface = "SmoothNoOutlines"
  469. RealBarrel.BottomSurface = "SmoothNoOutlines"
  470. RealBarrel.FrontSurface = "SmoothNoOutlines"
  471. RealBarrel.BackSurface = "SmoothNoOutlines"
  472. RealBarrel.RightSurface = "SmoothNoOutlines"
  473. RealBarrel.LeftSurface = "SmoothNoOutlines"
  474. RealBarrel.BrickColor = BrickColor.new("Dark grey metallic")
  475. local Mesh = Instance.new("CylinderMesh",RealBarrel)
  476. Mesh.Scale = Vector3.new(0.2,2,0.2) / 0.2 * Scale
  477. local RealBarrelWeld = Instance.new("Motor6D")
  478. RealBarrelWeld.Part0 = Barrel
  479. RealBarrelWeld.Part1 = RealBarrel
  480. RealBarrelWeld.C0 = CFrame.new(Vector3.new(0,0.1,-0.01)*Scale) * CFrame.Angles(math.rad(-90),0,0)
  481. RealBarrelWeld.Parent = RealBarrel
  482.  
  483. for i = 1,75,15 do
  484. local Part = Instance.new("Part",Model)
  485. Part.CanCollide = false
  486. Part.Position = Vector3.new(0,100,0)
  487. Part:BreakJoints()
  488. Part.FormFactor = "Custom"
  489. Part.Size = Vector3.new(0.2,0.2,0.2)
  490. Part.TopSurface = "SmoothNoOutlines"
  491. Part.BottomSurface = "SmoothNoOutlines"
  492. Part.FrontSurface = "SmoothNoOutlines"
  493. Part.BackSurface = "SmoothNoOutlines"
  494. Part.RightSurface = "SmoothNoOutlines"
  495. Part.LeftSurface = "SmoothNoOutlines"
  496. Part.BrickColor = BrickColor.new("Black")
  497. local Mesh = Instance.new("BlockMesh",Part)
  498. Mesh.Scale = Vector3.new(0.05,0.065,0.05) / 0.2 * Scale
  499. local PartWeld = Instance.new("Motor6D")
  500. PartWeld.Part0 = Handle
  501. PartWeld.Part1 = Part
  502. PartWeld.C0 = CFrame.new(Vector3.new(0,0.525,-0.515)*Scale) * CFrame.Angles(math.rad(i),0,0) * CFrame.new(Vector3.new(0,0,0.2)*Scale)
  503. PartWeld.Parent = Part
  504. end
  505.  
  506. local Part = Instance.new("Part",Model)
  507. Part.CanCollide = false
  508. Part.Position = Vector3.new(0,100,0)
  509. Part:BreakJoints()
  510. Part.FormFactor = "Custom"
  511. Part.Size = Vector3.new(0.2,0.2,0.2)
  512. Part.TopSurface = "SmoothNoOutlines"
  513. Part.BottomSurface = "SmoothNoOutlines"
  514. Part.FrontSurface = "SmoothNoOutlines"
  515. Part.BackSurface = "SmoothNoOutlines"
  516. Part.RightSurface = "SmoothNoOutlines"
  517. Part.LeftSurface = "SmoothNoOutlines"
  518. Part.BrickColor = BrickColor.new("Really black")
  519. local Mesh = Instance.new("BlockMesh",Part)
  520. Mesh.Scale = Vector3.new(0.05,0.11,0.1) / 0.2 * Scale
  521. local PartWeld = Instance.new("Motor6D")
  522. PartWeld.Part0 = Barrel2
  523. PartWeld.Part1 = Part
  524. PartWeld.C0 = CFrame.new(Vector3.new(0.06,0.135,0.925)*Scale)
  525. PartWeld.Parent = Part
  526.  
  527. local Part = Instance.new("Part",Model)
  528. Part.CanCollide = false
  529. Part.Position = Vector3.new(0,100,0)
  530. Part:BreakJoints()
  531. Part.FormFactor = "Custom"
  532. Part.Size = Vector3.new(0.2,0.2,0.2)
  533. Part.TopSurface = "SmoothNoOutlines"
  534. Part.BottomSurface = "SmoothNoOutlines"
  535. Part.FrontSurface = "SmoothNoOutlines"
  536. Part.BackSurface = "SmoothNoOutlines"
  537. Part.RightSurface = "SmoothNoOutlines"
  538. Part.LeftSurface = "SmoothNoOutlines"
  539. Part.BrickColor = BrickColor.new("Really black")
  540. local Mesh = Instance.new("BlockMesh",Part)
  541. Mesh.Scale = Vector3.new(0.05,0.11,0.1) / 0.2 * Scale
  542. local PartWeld = Instance.new("Motor6D")
  543. PartWeld.Part0 = Barrel2
  544. PartWeld.Part1 = Part
  545. PartWeld.C0 = CFrame.new(Vector3.new(-0.06,0.135,0.925)*Scale)
  546. PartWeld.Parent = Part
  547.  
  548. local Part = Instance.new("Part",Model)
  549. Part.CanCollide = false
  550. Part.Position = Vector3.new(0,100,0)
  551. Part:BreakJoints()
  552. Part.FormFactor = "Custom"
  553. Part.Size = Vector3.new(0.2,0.2,0.2)
  554. Part.TopSurface = "SmoothNoOutlines"
  555. Part.BottomSurface = "SmoothNoOutlines"
  556. Part.FrontSurface = "SmoothNoOutlines"
  557. Part.BackSurface = "SmoothNoOutlines"
  558. Part.RightSurface = "SmoothNoOutlines"
  559. Part.LeftSurface = "SmoothNoOutlines"
  560. Part.BrickColor = BrickColor.new("Really black")
  561. local Mesh = Instance.new("BlockMesh",Part)
  562. Mesh.Scale = Vector3.new(0.025,0.1,0.1) / 0.2 * Scale
  563. local PartWeld = Instance.new("Motor6D")
  564. PartWeld.Part0 = Barrel2
  565. PartWeld.Part1 = Part
  566. PartWeld.C0 = CFrame.new(Vector3.new(0,0.135,-0.925)*Scale)
  567. PartWeld.Parent = Part
  568.  
  569. local Part = Instance.new("Part",Model)
  570. Part.CanCollide = false
  571. Part.Position = Vector3.new(0,100,0)
  572. Part:BreakJoints()
  573. Part.FormFactor = "Custom"
  574. Part.Size = Vector3.new(0.2,0.2,0.2)
  575. Part.Transparency = 1
  576. Part.TopSurface = "SmoothNoOutlines"
  577. Part.BottomSurface = "SmoothNoOutlines"
  578. Part.FrontSurface = "SmoothNoOutlines"
  579. Part.BackSurface = "SmoothNoOutlines"
  580. Part.RightSurface = "SmoothNoOutlines"
  581. Part.LeftSurface = "SmoothNoOutlines"
  582. Part.BrickColor = BrickColor.new("Really black")
  583. local Mesh = Instance.new("BlockMesh",Part)
  584. Mesh.Scale = Vector3.new(0.1,0.1,0.1) / 0.2 * Scale
  585. local PartWeld = Instance.new("Motor6D")
  586. PartWeld.Part0 = Barrel
  587. PartWeld.Part1 = Part
  588. PartWeld.C0 = CFrame.new(Vector3.new(0,0,-5)*Scale)
  589. PartWeld.Parent = Part
  590.  
  591. local Light = Instance.new("PointLight",Part)
  592. Light.Color = BrickColor.new("Gold").Color
  593. Light.Enabled = true
  594. Light.Shadows = true
  595. Light.Brightness = 0
  596. Light.Range = 6
  597.  
  598. local Part = Instance.new("Part",Model)
  599. Part.Material = "Neon"
  600. Part.CanCollide = false
  601. Part.Position = Vector3.new(0,100,0)
  602. Part:BreakJoints()
  603. Part.FormFactor = "Custom"
  604. Part.Size = Vector3.new(0.2,0.2,0.2)
  605. Part.TopSurface = "SmoothNoOutlines"
  606. Part.BottomSurface = "SmoothNoOutlines"
  607. Part.FrontSurface = "SmoothNoOutlines"
  608. Part.BackSurface = "SmoothNoOutlines"
  609. Part.RightSurface = "SmoothNoOutlines"
  610. Part.LeftSurface = "SmoothNoOutlines"
  611. Part.BrickColor = BrickColor.new("Bright yellow")
  612. Part.Transparency = 0.25
  613. local RecoilMesh = Instance.new("SpecialMesh",Part)
  614. RecoilMesh.MeshType = "FileMesh"
  615. RecoilMesh.MeshId = "http://www.roblox.com/Asset/?id=1323306"
  616. RecoilMesh.TextureId = "http://www.roblox.com/Asset/?id=98896228"
  617. RecoilMesh.Scale = Vector3.new(0.175,0,0.175) * Scale
  618. local PartWeld = Instance.new("Motor6D")
  619. PartWeld.Part0 = RealBarrel
  620. PartWeld.Part1 = Part
  621. PartWeld.C0 = CFrame.new(Vector3.new(0,0.95,0)*Scale)
  622. PartWeld.Parent = Part
  623.  
  624. function ShootBullet(Target,barrel)
  625. local barrel = barrel or Barrel
  626. local Bullet = Instance.new("Part",Workspace)
  627. Barrel.CanCollide = false
  628. Bullet.FormFactor = "Custom"
  629. Bullet.Size = Vector3.new(0.2,0.2,5)*Scale
  630. Bullet.TopSurface = "Smooth"
  631. Bullet.BottomSurface = "Smooth"
  632. Bullet.Anchored = true
  633. Bullet.CanCollide = false
  634. Bullet.CFrame = CFrame.new((barrel.CFrame*CFrame.new(0,0,-barrel.Size.Z*barrel.Mesh.Scale.Z/2)).p,Target)*CFrame.new(0,0,-Bullet.Size.Z/2)
  635. Bullet.Transparency = 0.1
  636. Bullet.BrickColor = BrickColor.new("Gold")
  637. --[[local Mesh = Instance.new("SpecialMesh",Bullet)
  638. Mesh.MeshType = "FileMesh"
  639. Mesh.Scale = Vector3.new(0.5,0.5,0.2)
  640. Mesh.MeshId = "http://www.roblox.com/asset/?id=2697549"
  641. --Mesh.TextureId = "http://www.roblox.com/asset/?id=2697544"]]
  642. local Mesh = Instance.new("BlockMesh",Bullet)
  643. Mesh.Scale = Vector3.new(0.2,0.2,5)*Scale/Bullet.Size
  644. IgnoreList[#IgnoreList+1] = Bullet
  645. RenderStepped:wait()
  646. for i = Speed,1000,Speed do -- Loop to do the bullet movement and stuff.
  647. local ray,Hit,Pos,SurfaceNormal;
  648. ray = Ray.new(Bullet.Position,((Bullet.CFrame*CFrame.Angles(math.rad(-Gravity),0,0)*CFrame.new(0,0,-Speed)).p-Bullet.Position).unit*Speed)
  649. Hit,Pos,SurfaceNormal = Workspace:FindPartOnRayWithIgnoreList(ray,IgnoreList)
  650. Bullet.CFrame = Bullet.CFrame*CFrame.Angles(math.rad(-Gravity),0,0)*CFrame.new(0,0,-Speed)
  651. if Hit ~= nil then
  652. local Hum = Hit.Parent:FindFirstChild("Humanoid") or Hit.Parent.Parent:FindFirstChild("Humanoid") or (Hit.Parent.Parent.Parent ~= nil and Hit.Parent.Parent.Parent:FindFirstChild("Humanoid"))
  653. if Hum ~= nil then
  654. Hum:TakeDamage((((Gangster and math.random(99999,99999) or math.random(99999,99999))*Scale)/100)*Hum.MaxHealth)
  655. end
  656. break
  657. end
  658. RenderStepped:wait()
  659. end
  660. Bullet:Destroy()
  661. end
  662.  
  663. Mouse.Button1Down:connect(function()
  664. if not Down and not DB then
  665. Down = true
  666. while Down do
  667. if Humanoid.Health == 0 then break end
  668. if not DB then
  669. DB = true
  670. local Sound = Instance.new("Sound",Barrel)
  671. Sound.SoundId = "http://www.roblox.com/Asset/?id=165946426" -- 132373574
  672. Sound.Volume = 5*Scale
  673. Sound.Pitch = (math.random(70,110)/100)/((Scale < 0.25 and 0.25) or (Scale > 4 and 4) or Scale)
  674. Sound:Play()
  675. Spawn(function()
  676. ShootBullet(Mouse.Hit.p,Barrel1)
  677. end)
  678. RecoilMesh.VertexColor = Vector3.new(1,math.random(160,245)/255,20/255)
  679. PartWeld.C0 = PartWeld.C0 * CFrame.Angles(0,math.rad(math.random(-40,40)),0)
  680. local Shell = Instance.new("Part",Workspace)
  681. Shell.FormFactor = "Custom"
  682. Shell.BrickColor = BrickColor.new("Bright yellow")
  683. Shell.Size = Vector3.new(0.2,0.5,0.2)*Scale
  684. Shell.CFrame = Barrel.CFrame*CFrame.new(0.5,0.5,0)*CFrame.Angles(math.rad(-90),0,0)
  685. Shell.Velocity = ((Barrel.CFrame*CFrame.new(5,0,math.random(-2,2))).p-Barrel.CFrame.p)*5*Scale
  686. local Mesh = Instance.new("CylinderMesh",Shell)
  687. Mesh.Scale = Vector3.new(0.2,0.5,0.2)*Scale/Shell.Size
  688. Spawn(function()
  689. wait(5)
  690. Shell:Destroy()
  691. end)
  692. for i = 1,20,7.5 do
  693. RotationOffset = RotationOffset*CFrame.Angles(math.rad(7.5),0,0)
  694. Part1Joint = Part1Joint*CFrame.new(Vector3.new(0,-0.15,0)*Scale)
  695. Barrel2Weld.C0 = Barrel2Weld.C0*CFrame.new(Vector3.new(0,0,0.15)*Scale)
  696. Light.Brightness = Light.Brightness+38
  697. RecoilMesh.Scale = RecoilMesh.Scale+(Vector3.new(0,0.375,0)*Scale)
  698. RenderStepped:wait()
  699. end
  700. wait(0.02)
  701. for i = 1,20,3.75 do
  702. RotationOffset = RotationOffset*CFrame.Angles(math.rad(-3.75),0,0)
  703. Part1Joint = Part1Joint*CFrame.new(Vector3.new(0,0.075,0)*Scale)
  704. Barrel2Weld.C0 = Barrel2Weld.C0*CFrame.new(Vector3.new(0,0,-0.075)*Scale)
  705. Light.Brightness = Light.Brightness-19
  706. RecoilMesh.Scale = RecoilMesh.Scale+(Vector3.new(0,-0.1875,0)*Scale)
  707. RenderStepped:wait()
  708. end
  709. wait(0.02)
  710. DB = false
  711. end
  712. end
  713. end
  714. end)
  715.  
  716. Mouse.Button1Up:connect(function()
  717. Down = false
  718. end)
  719.  
  720. Mouse.KeyDown:connect(function(Key)
  721. if Key:lower() == "g" and not DB then
  722. DB = true
  723. if Gangster == true then
  724. for i = 1,70,5 do
  725. RotationOffset = RotationOffset*CFrame.Angles(0,math.rad(-5),0)
  726. RenderStepped:wait()
  727. end
  728. Gangster = false
  729. else
  730. for i = 1,70,5 do
  731. RotationOffset = RotationOffset*CFrame.Angles(0,math.rad(5),0)
  732. RenderStepped:wait()
  733. end
  734. Gangster = true
  735. end
  736. DB = false
  737. end
  738. end)
  739.  
  740. local Weld = Instance.new("Weld")
  741. Weld.Part0 = Torso
  742. Weld.Part1 = Character["Right Arm"]
  743. Weld.Parent = Torso
  744.  
  745. local Weld2 = Instance.new("Weld")
  746. Weld2.Part0 = Torso
  747. Weld2.Part1 = Character.Head
  748. Weld2.Parent = Torso
  749.  
  750. local RA = Character["Right Arm"]
  751.  
  752. game:GetService("RunService"):BindToRenderStep("Pistol",Enum.RenderPriority.Character.Value,function()
  753. local Point = Torso.CFrame:vectorToObjectSpace(Mouse.Hit.p-Torso.CFrame.p)
  754. if Point.Z > 0 then
  755. if Point.X > 0 then
  756. Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(Mouse.Hit.X,Torso.Position.Y,Mouse.Hit.Z))*CFrame.Angles(0,math.rad(90),0)
  757. elseif Point.X < 0 then
  758. Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(Mouse.Hit.X,Torso.Position.Y,Mouse.Hit.Z))*CFrame.Angles(0,math.rad(-90),0)
  759. end
  760. end
  761.  
  762. local CFr = (Torso.CFrame*Part0Joint):toObjectSpace(CFrame.new((Torso.CFrame*Part0Joint).p,Mouse.Hit.p))--RayEnd))
  763. Weld.C0 = Part0Joint * (CFr-CFr.p) * RotationOffset
  764. Weld.C1 = Part1Joint
  765. Weld.Part0 = Torso
  766. Weld.Part1 = RA
  767. local CFr = (Torso.CFrame*Part0JointHead):toObjectSpace(CFrame.new((Torso.CFrame*Part0JointHead).p,Mouse.Hit.p))--RayEnd))
  768. Weld2.C0 = Part0JointHead * (CFr-CFr.p) * RotationOffsetHead
  769. Weld2.C1 = Part1JointHead
  770. Weld2.Part0 = Torso
  771. Weld2.Part1 = Character.Head
  772. local Last = Scale
  773. Scale = game.Players.LocalPlayer.Character.Torso.Size.X/2*(game.Players.LocalPlayer.Character.Torso:FindFirstChild("ScaleInserted") ~= nil and game.Players.LocalPlayer.Character.Torso:FindFirstChild("ScaleInserted").Scale.Z or 1)*0.8
  774. Speed = 20*Scale
  775. if Scale ~= Last then
  776. Part0Joint = CFrame.new(Vector3.new(1,0.75,0)*Scale*1.25)
  777. Part1Joint = CFrame.new(Vector3.new(-0.5,0.75,0)*Scale*1.25)
  778. Part0JointHead = CFrame.new(Vector3.new(0,1,0)*Scale*1.25)
  779. Part1JointHead = CFrame.new(Vector3.new(0,-0.5,0)*Scale*1.25)
  780. end
  781. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement