Advertisement
WagnerJunio07

Real Glock

Dec 28th, 2018
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.78 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.  
  88. 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
  89. local Speed = 20*Scale
  90. local Gravity = 0.1
  91.  
  92. local Player = owner
  93. local Character = Player.Character
  94. local Humanoid = Character.Humanoid
  95. Humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll,false)
  96. local Torso = Character.HumanoidRootPart
  97. local Camera = Workspace.CurrentCamera
  98. Camera:ClearAllChildren()
  99. local Model = Instance.new("Model",Character)
  100. local IgnoreList = {Character,Workspace.Terrain}
  101.  
  102. local Part0Joint = CFrame.new(Vector3.new(1,0.75,0)*Scale*1.25)
  103. local Part1Joint = CFrame.new(Vector3.new(-0.5,0.75,0)*Scale*1.25)
  104. local RotationOffset = CFrame.Angles(math.rad(90),math.rad(0),0)
  105. local Gangster = false
  106.  
  107. local Part0JointHead = CFrame.new(Vector3.new(0,1,0)*Scale*1.25)
  108. local Part1JointHead = CFrame.new(Vector3.new(0,-0.5,0)*Scale*1.25)
  109. local RotationOffsetHead = CFrame.Angles(0,0,0)
  110.  
  111. local Handle = Instance.new("Part",Model)
  112. Handle.CanCollide = false
  113. Handle.Name = "Handle"
  114. Handle.Position = Vector3.new(0,100,0)
  115. Handle:BreakJoints()
  116. Handle.FormFactor = "Custom"
  117. Handle.Size = Vector3.new(0.2,0.2,0.2)
  118. Handle.TopSurface = "SmoothNoOutlines"
  119. Handle.BottomSurface = "SmoothNoOutlines"
  120. Handle.FrontSurface = "SmoothNoOutlines"
  121. Handle.BackSurface = "SmoothNoOutlines"
  122. Handle.RightSurface = "SmoothNoOutlines"
  123. Handle.LeftSurface = "SmoothNoOutlines"
  124. Handle.BrickColor = BrickColor.new("Black")
  125. local Mesh = Instance.new("BlockMesh",Handle)
  126. Mesh.Scale = Vector3.new(0.25,1,0.4) / 0.2 * Scale
  127. local HandleWeld = Instance.new("Motor6D")
  128. HandleWeld.Part0 = Character["Right Arm"]
  129. HandleWeld.Part1 = Handle
  130. HandleWeld.C0 = CFrame.new(Vector3.new(0,-1,0)*Scale) * CFrame.Angles(math.rad(-105),0,0)
  131. HandleWeld.Parent = Handle
  132.  
  133. local Part = Instance.new("Part",Model)
  134. Part.CanCollide = false
  135. Part.Position = Vector3.new(0,100,0)
  136. Part:BreakJoints()
  137. Part.FormFactor = "Custom"
  138. Part.Size = Vector3.new(0.2,0.2,0.2)
  139. Part.TopSurface = "SmoothNoOutlines"
  140. Part.BottomSurface = "SmoothNoOutlines"
  141. Part.FrontSurface = "SmoothNoOutlines"
  142. Part.BackSurface = "SmoothNoOutlines"
  143. Part.RightSurface = "SmoothNoOutlines"
  144. Part.LeftSurface = "SmoothNoOutlines"
  145. Part.BrickColor = BrickColor.new("Black")
  146. local Mesh = Instance.new("CylinderMesh",Part)
  147. Mesh.Scale = Vector3.new(0.07,0.2,0.07) / 0.2 * Scale
  148. local PartWeld = Instance.new("Motor6D")
  149. PartWeld.Part0 = Handle
  150. PartWeld.Part1 = Part
  151. PartWeld.C0 = CFrame.new(Vector3.new(-0.115,-0.475,-0.190)*Scale) * CFrame.Angles(0,0,0)
  152. PartWeld.Parent = Part
  153.  
  154. local Part = Instance.new("Part",Model)
  155. Part.CanCollide = false
  156. Part.Position = Vector3.new(0,100,0)
  157. Part:BreakJoints()
  158. Part.FormFactor = "Custom"
  159. Part.Size = Vector3.new(0.2,0.2,0.2)
  160. Part.TopSurface = "SmoothNoOutlines"
  161. Part.BottomSurface = "SmoothNoOutlines"
  162. Part.FrontSurface = "SmoothNoOutlines"
  163. Part.BackSurface = "SmoothNoOutlines"
  164. Part.RightSurface = "SmoothNoOutlines"
  165. Part.LeftSurface = "SmoothNoOutlines"
  166. Part.BrickColor = BrickColor.new("Black")
  167. local Mesh = Instance.new("CylinderMesh",Part)
  168. Mesh.Scale = Vector3.new(0.07,0.2,0.07) / 0.2 * Scale
  169. local PartWeld = Instance.new("Motor6D")
  170. PartWeld.Part0 = Handle
  171. PartWeld.Part1 = Part
  172. PartWeld.C0 = CFrame.new(Vector3.new(0.115,-0.475,0.190)*Scale) * CFrame.Angles(0,0,0)
  173. PartWeld.Parent = Part
  174.  
  175. local Part = Instance.new("Part",Model)
  176. Part.CanCollide = false
  177. Part.Position = Vector3.new(0,100,0)
  178. Part:BreakJoints()
  179. Part.FormFactor = "Custom"
  180. Part.Size = Vector3.new(0.2,0.2,0.2)
  181. Part.TopSurface = "SmoothNoOutlines"
  182. Part.BottomSurface = "SmoothNoOutlines"
  183. Part.FrontSurface = "SmoothNoOutlines"
  184. Part.BackSurface = "SmoothNoOutlines"
  185. Part.RightSurface = "SmoothNoOutlines"
  186. Part.LeftSurface = "SmoothNoOutlines"
  187. Part.BrickColor = BrickColor.new("Black")
  188. local Mesh = Instance.new("CylinderMesh",Part)
  189. Mesh.Scale = Vector3.new(0.07,0.2,0.07) / 0.2 * Scale
  190. local PartWeld = Instance.new("Motor6D")
  191. PartWeld.Part0 = Handle
  192. PartWeld.Part1 = Part
  193. PartWeld.C0 = CFrame.new(Vector3.new(-0.115,-0.475,0.190)*Scale) * CFrame.Angles(0,0,0)
  194. PartWeld.Parent = Part
  195.  
  196. local Part = Instance.new("Part",Model)
  197. Part.CanCollide = false
  198. Part.Position = Vector3.new(0,100,0)
  199. Part:BreakJoints()
  200. Part.FormFactor = "Custom"
  201. Part.Size = Vector3.new(0.2,0.2,0.2)
  202. Part.TopSurface = "SmoothNoOutlines"
  203. Part.BottomSurface = "SmoothNoOutlines"
  204. Part.FrontSurface = "SmoothNoOutlines"
  205. Part.BackSurface = "SmoothNoOutlines"
  206. Part.RightSurface = "SmoothNoOutlines"
  207. Part.LeftSurface = "SmoothNoOutlines"
  208. Part.BrickColor = BrickColor.new("Black")
  209. local Mesh = Instance.new("CylinderMesh",Part)
  210. Mesh.Scale = Vector3.new(0.07,0.2,0.07) / 0.2 * Scale
  211. local PartWeld = Instance.new("Motor6D")
  212. PartWeld.Part0 = Handle
  213. PartWeld.Part1 = Part
  214. PartWeld.C0 = CFrame.new(Vector3.new(0.115,-0.475,-0.190)*Scale) * CFrame.Angles(0,0,0)
  215. PartWeld.Parent = Part
  216.  
  217. local Part = Instance.new("Part",Model)
  218. Part.CanCollide = false
  219. Part.Position = Vector3.new(0,100,0)
  220. Part:BreakJoints()
  221. Part.FormFactor = "Custom"
  222. Part.Size = Vector3.new(0.2,0.2,0.2)
  223. Part.TopSurface = "SmoothNoOutlines"
  224. Part.BottomSurface = "SmoothNoOutlines"
  225. Part.FrontSurface = "SmoothNoOutlines"
  226. Part.BackSurface = "SmoothNoOutlines"
  227. Part.RightSurface = "SmoothNoOutlines"
  228. Part.LeftSurface = "SmoothNoOutlines"
  229. Part.BrickColor = BrickColor.new("Black")
  230. local Mesh = Instance.new("BlockMesh",Part)
  231. Mesh.Scale = Vector3.new(0.23,0.2,0.1) / 0.2 * Scale
  232. local PartWeld = Instance.new("Motor6D")
  233. PartWeld.Part0 = Handle
  234. PartWeld.Part1 = Part
  235. PartWeld.C0 = CFrame.new(Vector3.new(0,-0.475,-0.175)*Scale) * CFrame.Angles(0,0,0)
  236. PartWeld.Parent = Part
  237.  
  238. local Part = Instance.new("Part",Model)
  239. Part.CanCollide = false
  240. Part.Position = Vector3.new(0,100,0)
  241. Part:BreakJoints()
  242. Part.FormFactor = "Custom"
  243. Part.Size = Vector3.new(0.2,0.2,0.2)
  244. Part.TopSurface = "SmoothNoOutlines"
  245. Part.BottomSurface = "SmoothNoOutlines"
  246. Part.FrontSurface = "SmoothNoOutlines"
  247. Part.BackSurface = "SmoothNoOutlines"
  248. Part.RightSurface = "SmoothNoOutlines"
  249. Part.LeftSurface = "SmoothNoOutlines"
  250. Part.BrickColor = BrickColor.new("Black")
  251. local Mesh = Instance.new("BlockMesh",Part)
  252. Mesh.Scale = Vector3.new(0.23,0.2,0.1) / 0.2 * Scale
  253. local PartWeld = Instance.new("Motor6D")
  254. PartWeld.Part0 = Handle
  255. PartWeld.Part1 = Part
  256. PartWeld.C0 = CFrame.new(Vector3.new(0,-0.475,0.175)*Scale) * CFrame.Angles(0,0,0)
  257. PartWeld.Parent = Part
  258.  
  259. local Part = Instance.new("Part",Model)
  260. Part.CanCollide = false
  261. Part.Position = Vector3.new(0,100,0)
  262. Part:BreakJoints()
  263. Part.FormFactor = "Custom"
  264. Part.Size = Vector3.new(0.2,0.2,0.2)
  265. Part.TopSurface = "SmoothNoOutlines"
  266. Part.BottomSurface = "SmoothNoOutlines"
  267. Part.FrontSurface = "SmoothNoOutlines"
  268. Part.BackSurface = "SmoothNoOutlines"
  269. Part.RightSurface = "SmoothNoOutlines"
  270. Part.LeftSurface = "SmoothNoOutlines"
  271. Part.BrickColor = BrickColor.new("Black")
  272. local Mesh = Instance.new("BlockMesh",Part)
  273. Mesh.Scale = Vector3.new(0.1,0.2,0.38) / 0.2 * Scale
  274. local PartWeld = Instance.new("Motor6D")
  275. PartWeld.Part0 = Handle
  276. PartWeld.Part1 = Part
  277. PartWeld.C0 = CFrame.new(Vector3.new(-0.1,-0.475,0)*Scale) * CFrame.Angles(0,0,0)
  278. PartWeld.Parent = Part
  279.  
  280. local Part = Instance.new("Part",Model)
  281. Part.CanCollide = false
  282. Part.Position = Vector3.new(0,100,0)
  283. Part:BreakJoints()
  284. Part.FormFactor = "Custom"
  285. Part.Size = Vector3.new(0.2,0.2,0.2)
  286. Part.TopSurface = "SmoothNoOutlines"
  287. Part.BottomSurface = "SmoothNoOutlines"
  288. Part.FrontSurface = "SmoothNoOutlines"
  289. Part.BackSurface = "SmoothNoOutlines"
  290. Part.RightSurface = "SmoothNoOutlines"
  291. Part.LeftSurface = "SmoothNoOutlines"
  292. Part.BrickColor = BrickColor.new("Black")
  293. local Mesh = Instance.new("BlockMesh",Part)
  294. Mesh.Scale = Vector3.new(0.1,0.2,0.38) / 0.2 * Scale
  295. local PartWeld = Instance.new("Motor6D")
  296. PartWeld.Part0 = Handle
  297. PartWeld.Part1 = Part
  298. PartWeld.C0 = CFrame.new(Vector3.new(0.1,-0.475,0)*Scale) * CFrame.Angles(0,0,0)
  299. PartWeld.Parent = Part
  300.  
  301. local Part = Instance.new("Part",Model)
  302. Part.CanCollide = false
  303. Part.Position = Vector3.new(0,100,0)
  304. Part:BreakJoints()
  305. Part.FormFactor = "Custom"
  306. Part.Size = Vector3.new(0.2,0.2,0.2)
  307. Part.TopSurface = "SmoothNoOutlines"
  308. Part.BottomSurface = "SmoothNoOutlines"
  309. Part.FrontSurface = "SmoothNoOutlines"
  310. Part.BackSurface = "SmoothNoOutlines"
  311. Part.RightSurface = "SmoothNoOutlines"
  312. Part.LeftSurface = "SmoothNoOutlines"
  313. Part.BrickColor = BrickColor.new("Black")
  314. local Mesh = Instance.new("BlockMesh",Part)
  315. Mesh.Scale = Vector3.new(0.1,0.3,0.05) / 0.2 * Scale
  316. local PartWeld = Instance.new("Motor6D")
  317. PartWeld.Part0 = Handle
  318. PartWeld.Part1 = Part
  319. 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)
  320. PartWeld.Parent = Part
  321.  
  322. local Part = Instance.new("Part",Model)
  323. Part.CanCollide = false
  324. Part.Position = Vector3.new(0,100,0)
  325. Part:BreakJoints()
  326. Part.FormFactor = "Custom"
  327. Part.Size = Vector3.new(0.2,0.2,0.2)
  328. Part.TopSurface = "SmoothNoOutlines"
  329. Part.BottomSurface = "SmoothNoOutlines"
  330. Part.FrontSurface = "SmoothNoOutlines"
  331. Part.BackSurface = "SmoothNoOutlines"
  332. Part.RightSurface = "SmoothNoOutlines"
  333. Part.LeftSurface = "SmoothNoOutlines"
  334. Part.BrickColor = BrickColor.new("Black")
  335. local Mesh = Instance.new("BlockMesh",Part)
  336. Mesh.Scale = Vector3.new(0.1,0.05,0.625) / 0.2 * Scale
  337. local PartWeld = Instance.new("Motor6D")
  338. PartWeld.Part0 = Handle
  339. PartWeld.Part1 = Part
  340. PartWeld.C0 = CFrame.Angles(math.rad(15),0,0) * CFrame.new(Vector3.new(0,0.1,-0.435)*Scale)
  341. PartWeld.Parent = Part
  342.  
  343. for i = 0,80,10 do
  344. local Part = Instance.new("Part",Model)
  345. Part.CanCollide = false
  346. Part.Position = Vector3.new(0,100,0)
  347. Part:BreakJoints()
  348. Part.FormFactor = "Custom"
  349. Part.Size = Vector3.new(0.2,0.2,0.2)
  350. Part.TopSurface = "SmoothNoOutlines"
  351. Part.BottomSurface = "SmoothNoOutlines"
  352. Part.FrontSurface = "SmoothNoOutlines"
  353. Part.BackSurface = "SmoothNoOutlines"
  354. Part.RightSurface = "SmoothNoOutlines"
  355. Part.LeftSurface = "SmoothNoOutlines"
  356. Part.BrickColor = BrickColor.new("Black")
  357. local Mesh = Instance.new("BlockMesh",Part)
  358. Mesh.Scale = Vector3.new(0.25,0.15,0.03555*2) / 0.2 * Scale
  359. local PartWeld = Instance.new("Motor6D")
  360. PartWeld.Part0 = Handle
  361. PartWeld.Part1 = Part
  362. 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)
  363. PartWeld.Parent = Part
  364. end
  365.  
  366. local Barrel = Instance.new("Part",Model)
  367. Barrel.CanCollide = false
  368. Barrel.Position = Vector3.new(0,100,0)
  369. Barrel:BreakJoints()
  370. Barrel.FormFactor = "Custom"
  371. Barrel.Size = Vector3.new(0.2,0.2,0.2)
  372. Barrel.TopSurface = "SmoothNoOutlines"
  373. Barrel.BottomSurface = "SmoothNoOutlines"
  374. Barrel.FrontSurface = "SmoothNoOutlines"
  375. Barrel.BackSurface = "SmoothNoOutlines"
  376. Barrel.RightSurface = "SmoothNoOutlines"
  377. Barrel.LeftSurface = "SmoothNoOutlines"
  378. Barrel.BrickColor = BrickColor.new("Black")
  379. local Mesh = Instance.new("BlockMesh",Barrel)
  380. Mesh.Scale = Vector3.new(0.25,0.2,2) / 0.2 * Scale
  381. local BarrelWeld = Instance.new("Motor6D")
  382. BarrelWeld.Part0 = Handle
  383. BarrelWeld.Part1 = Barrel
  384. BarrelWeld.C0 = CFrame.Angles(math.rad(15),0,0) * CFrame.new(Vector3.new(0,0.5,-0.7)*Scale)
  385. BarrelWeld.Parent = Barrel
  386.  
  387. local Barrel1 = Barrel
  388.  
  389. local Barrel2 = Instance.new("Part",Model)
  390. Barrel2.CanCollide = false
  391. Barrel2.Position = Vector3.new(0,100,0)
  392. Barrel2:BreakJoints()
  393. Barrel2.FormFactor = "Custom"
  394. Barrel2.Size = Vector3.new(0.2,0.2,0.2)
  395. Barrel2.TopSurface = "SmoothNoOutlines"
  396. Barrel2.BottomSurface = "SmoothNoOutlines"
  397. Barrel2.FrontSurface = "SmoothNoOutlines"
  398. Barrel2.BackSurface = "SmoothNoOutlines"
  399. Barrel2.RightSurface = "SmoothNoOutlines"
  400. Barrel2.LeftSurface = "SmoothNoOutlines"
  401. Barrel2.BrickColor = BrickColor.new("Really black")
  402. local Mesh = Instance.new("BlockMesh",Barrel2)
  403. Mesh.Scale = Vector3.new(0.25,0.25,2) / 0.2 * Scale
  404. local Barrel2Weld = Instance.new("Motor6D")
  405. Barrel2Weld.Part0 = Barrel
  406. Barrel2Weld.Part1 = Barrel2
  407. Barrel2Weld.C0 = CFrame.new(Vector3.new(0,0.225,0)*Scale)
  408. Barrel2Weld.Parent = Barrel2
  409.  
  410. local RealBarrel = Instance.new("Part",Model)
  411. RealBarrel.CanCollide = false
  412. RealBarrel.Position = Vector3.new(0,100,0)
  413. RealBarrel:BreakJoints()
  414. RealBarrel.FormFactor = "Custom"
  415. RealBarrel.Size = Vector3.new(0.2,0.2,0.2)
  416. RealBarrel.TopSurface = "SmoothNoOutlines"
  417. RealBarrel.BottomSurface = "SmoothNoOutlines"
  418. RealBarrel.FrontSurface = "SmoothNoOutlines"
  419. RealBarrel.BackSurface = "SmoothNoOutlines"
  420. RealBarrel.RightSurface = "SmoothNoOutlines"
  421. RealBarrel.LeftSurface = "SmoothNoOutlines"
  422. RealBarrel.BrickColor = BrickColor.new("Dark grey metallic")
  423. local Mesh = Instance.new("CylinderMesh",RealBarrel)
  424. Mesh.Scale = Vector3.new(0.2,2,0.2) / 0.2 * Scale
  425. local RealBarrelWeld = Instance.new("Motor6D")
  426. RealBarrelWeld.Part0 = Barrel
  427. RealBarrelWeld.Part1 = RealBarrel
  428. RealBarrelWeld.C0 = CFrame.new(Vector3.new(0,0.1,-0.01)*Scale) * CFrame.Angles(math.rad(-90),0,0)
  429. RealBarrelWeld.Parent = RealBarrel
  430.  
  431. for i = 1,75,15 do
  432. local Part = Instance.new("Part",Model)
  433. Part.CanCollide = false
  434. Part.Position = Vector3.new(0,100,0)
  435. Part:BreakJoints()
  436. Part.FormFactor = "Custom"
  437. Part.Size = Vector3.new(0.2,0.2,0.2)
  438. Part.TopSurface = "SmoothNoOutlines"
  439. Part.BottomSurface = "SmoothNoOutlines"
  440. Part.FrontSurface = "SmoothNoOutlines"
  441. Part.BackSurface = "SmoothNoOutlines"
  442. Part.RightSurface = "SmoothNoOutlines"
  443. Part.LeftSurface = "SmoothNoOutlines"
  444. Part.BrickColor = BrickColor.new("Black")
  445. local Mesh = Instance.new("BlockMesh",Part)
  446. Mesh.Scale = Vector3.new(0.05,0.065,0.05) / 0.2 * Scale
  447. local PartWeld = Instance.new("Motor6D")
  448. PartWeld.Part0 = Handle
  449. PartWeld.Part1 = Part
  450. 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)
  451. PartWeld.Parent = Part
  452. end
  453.  
  454. local Part = Instance.new("Part",Model)
  455. Part.CanCollide = false
  456. Part.Position = Vector3.new(0,100,0)
  457. Part:BreakJoints()
  458. Part.FormFactor = "Custom"
  459. Part.Size = Vector3.new(0.2,0.2,0.2)
  460. Part.TopSurface = "SmoothNoOutlines"
  461. Part.BottomSurface = "SmoothNoOutlines"
  462. Part.FrontSurface = "SmoothNoOutlines"
  463. Part.BackSurface = "SmoothNoOutlines"
  464. Part.RightSurface = "SmoothNoOutlines"
  465. Part.LeftSurface = "SmoothNoOutlines"
  466. Part.BrickColor = BrickColor.new("Really black")
  467. local Mesh = Instance.new("BlockMesh",Part)
  468. Mesh.Scale = Vector3.new(0.05,0.11,0.1) / 0.2 * Scale
  469. local PartWeld = Instance.new("Motor6D")
  470. PartWeld.Part0 = Barrel2
  471. PartWeld.Part1 = Part
  472. PartWeld.C0 = CFrame.new(Vector3.new(0.06,0.135,0.925)*Scale)
  473. PartWeld.Parent = Part
  474.  
  475. local Part = Instance.new("Part",Model)
  476. Part.CanCollide = false
  477. Part.Position = Vector3.new(0,100,0)
  478. Part:BreakJoints()
  479. Part.FormFactor = "Custom"
  480. Part.Size = Vector3.new(0.2,0.2,0.2)
  481. Part.TopSurface = "SmoothNoOutlines"
  482. Part.BottomSurface = "SmoothNoOutlines"
  483. Part.FrontSurface = "SmoothNoOutlines"
  484. Part.BackSurface = "SmoothNoOutlines"
  485. Part.RightSurface = "SmoothNoOutlines"
  486. Part.LeftSurface = "SmoothNoOutlines"
  487. Part.BrickColor = BrickColor.new("Really black")
  488. local Mesh = Instance.new("BlockMesh",Part)
  489. Mesh.Scale = Vector3.new(0.05,0.11,0.1) / 0.2 * Scale
  490. local PartWeld = Instance.new("Motor6D")
  491. PartWeld.Part0 = Barrel2
  492. PartWeld.Part1 = Part
  493. PartWeld.C0 = CFrame.new(Vector3.new(-0.06,0.135,0.925)*Scale)
  494. PartWeld.Parent = Part
  495.  
  496. local Part = Instance.new("Part",Model)
  497. Part.CanCollide = false
  498. Part.Position = Vector3.new(0,100,0)
  499. Part:BreakJoints()
  500. Part.FormFactor = "Custom"
  501. Part.Size = Vector3.new(0.2,0.2,0.2)
  502. Part.TopSurface = "SmoothNoOutlines"
  503. Part.BottomSurface = "SmoothNoOutlines"
  504. Part.FrontSurface = "SmoothNoOutlines"
  505. Part.BackSurface = "SmoothNoOutlines"
  506. Part.RightSurface = "SmoothNoOutlines"
  507. Part.LeftSurface = "SmoothNoOutlines"
  508. Part.BrickColor = BrickColor.new("Really black")
  509. local Mesh = Instance.new("BlockMesh",Part)
  510. Mesh.Scale = Vector3.new(0.025,0.1,0.1) / 0.2 * Scale
  511. local PartWeld = Instance.new("Motor6D")
  512. PartWeld.Part0 = Barrel2
  513. PartWeld.Part1 = Part
  514. PartWeld.C0 = CFrame.new(Vector3.new(0,0.135,-0.925)*Scale)
  515. PartWeld.Parent = Part
  516.  
  517. local Part = Instance.new("Part",Model)
  518. Part.CanCollide = false
  519. Part.Position = Vector3.new(0,100,0)
  520. Part:BreakJoints()
  521. Part.FormFactor = "Custom"
  522. Part.Size = Vector3.new(0.2,0.2,0.2)
  523. Part.Transparency = 1
  524. Part.TopSurface = "SmoothNoOutlines"
  525. Part.BottomSurface = "SmoothNoOutlines"
  526. Part.FrontSurface = "SmoothNoOutlines"
  527. Part.BackSurface = "SmoothNoOutlines"
  528. Part.RightSurface = "SmoothNoOutlines"
  529. Part.LeftSurface = "SmoothNoOutlines"
  530. Part.BrickColor = BrickColor.new("Really black")
  531. local Mesh = Instance.new("BlockMesh",Part)
  532. Mesh.Scale = Vector3.new(0.1,0.1,0.1) / 0.2 * Scale
  533. local PartWeld = Instance.new("Motor6D")
  534. PartWeld.Part0 = Barrel
  535. PartWeld.Part1 = Part
  536. PartWeld.C0 = CFrame.new(Vector3.new(0,0,-5)*Scale)
  537. PartWeld.Parent = Part
  538.  
  539. local Light = Instance.new("PointLight",Part)
  540. Light.Color = BrickColor.new("Gold").Color
  541. Light.Enabled = true
  542. Light.Shadows = true
  543. Light.Brightness = 0
  544. Light.Range = 6
  545.  
  546. local Part = Instance.new("Part",Model)
  547. Part.Material = "Neon"
  548. Part.CanCollide = false
  549. Part.Position = Vector3.new(0,100,0)
  550. Part:BreakJoints()
  551. Part.FormFactor = "Custom"
  552. Part.Size = Vector3.new(0.2,0.2,0.2)
  553. Part.TopSurface = "SmoothNoOutlines"
  554. Part.BottomSurface = "SmoothNoOutlines"
  555. Part.FrontSurface = "SmoothNoOutlines"
  556. Part.BackSurface = "SmoothNoOutlines"
  557. Part.RightSurface = "SmoothNoOutlines"
  558. Part.LeftSurface = "SmoothNoOutlines"
  559. Part.BrickColor = BrickColor.new("Bright yellow")
  560. Part.Transparency = 0.25
  561. local RecoilMesh = Instance.new("SpecialMesh",Part)
  562. RecoilMesh.MeshType = "FileMesh"
  563. RecoilMesh.MeshId = "http://www.roblox.com/Asset/?id=1323306"
  564. RecoilMesh.TextureId = "http://www.roblox.com/Asset/?id=98896228"
  565. RecoilMesh.Scale = Vector3.new(0.175,0,0.175) * Scale
  566. local PartWeld = Instance.new("Motor6D")
  567. PartWeld.Part0 = RealBarrel
  568. PartWeld.Part1 = Part
  569. PartWeld.C0 = CFrame.new(Vector3.new(0,0.95,0)*Scale)
  570. PartWeld.Parent = Part
  571.  
  572. function ShootBullet(Target,barrel)
  573. local barrel = barrel or Barrel
  574. local Bullet = Instance.new("Part",Workspace)
  575. Barrel.CanCollide = false
  576. Bullet.FormFactor = "Custom"
  577. Bullet.Size = Vector3.new(0.2,0.2,5)*Scale
  578. Bullet.TopSurface = "Smooth"
  579. Bullet.BottomSurface = "Smooth"
  580. Bullet.Anchored = true
  581. Bullet.CanCollide = false
  582. 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)
  583. Bullet.Transparency = 0.1
  584. Bullet.BrickColor = BrickColor.new("Gold")
  585. --[[local Mesh = Instance.new("SpecialMesh",Bullet)
  586. Mesh.MeshType = "FileMesh"
  587. Mesh.Scale = Vector3.new(0.5,0.5,0.2)
  588. Mesh.MeshId = "http://www.roblox.com/asset/?id=2697549"
  589. --Mesh.TextureId = "http://www.roblox.com/asset/?id=2697544"]]
  590. local Mesh = Instance.new("BlockMesh",Bullet)
  591. Mesh.Scale = Vector3.new(0.2,0.2,5)*Scale/Bullet.Size
  592. IgnoreList[#IgnoreList+1] = Bullet
  593. for i = Speed,1000,Speed do -- Loop to do the bullet movement and stuff.
  594. local ray,Hit,Pos,SurfaceNormal;
  595. ray = Ray.new(Bullet.Position,((Bullet.CFrame*CFrame.Angles(math.rad(-Gravity),0,0)*CFrame.new(0,0,-Speed)).p-Bullet.Position).unit*Speed)
  596. Hit,Pos,SurfaceNormal = Workspace:FindPartOnRayWithIgnoreList(ray,IgnoreList)
  597. Bullet.CFrame = Bullet.CFrame*CFrame.Angles(math.rad(-Gravity),0,0)*CFrame.new(0,0,-Speed)
  598. if Hit ~= nil then
  599. 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"))
  600. if Hum ~= nil then
  601. Hum:TakeDamage((((Gangster and math.random(99999,99999) or math.random(99999,99999))*Scale)/100)*Hum.MaxHealth)
  602. end
  603. break
  604. end
  605. end
  606. Bullet:Destroy()
  607. end
  608.  
  609. Mouse.Button1Down:connect(function()
  610. if not Down and not DB then
  611. Down = true
  612. while Down do
  613. if Humanoid.Health == 0 then break end
  614. if not DB then
  615. DB = true
  616. local Sound = Instance.new("Sound",Barrel)
  617. Sound.SoundId = "http://www.roblox.com/Asset/?id=165946426" -- 132373574
  618. Sound.Volume = 5*Scale
  619. Sound.Pitch = (math.random(70,110)/100)/((Scale < 0.25 and 0.25) or (Scale > 4 and 4) or Scale)
  620. Sound:Play()
  621. Spawn(function()
  622. ShootBullet(Mouse.Hit.p,Barrel1)
  623. end)
  624. RecoilMesh.VertexColor = Vector3.new(1,math.random(160,245)/255,20/255)
  625. PartWeld.C0 = PartWeld.C0 * CFrame.Angles(0,math.rad(math.random(-40,40)),0)
  626. local Shell = Instance.new("Part",Workspace)
  627. Shell.FormFactor = "Custom"
  628. Shell.BrickColor = BrickColor.new("Bright yellow")
  629. Shell.Size = Vector3.new(0.2,0.5,0.2)*Scale
  630. Shell.CFrame = Barrel.CFrame*CFrame.new(0.5,0.5,0)*CFrame.Angles(math.rad(-90),0,0)
  631. Shell.Velocity = ((Barrel.CFrame*CFrame.new(5,0,math.random(-2,2))).p-Barrel.CFrame.p)*5*Scale
  632. local Mesh = Instance.new("CylinderMesh",Shell)
  633. Mesh.Scale = Vector3.new(0.2,0.5,0.2)*Scale/Shell.Size
  634. Spawn(function()
  635. wait(5)
  636. Shell:Destroy()
  637. end)
  638. for i = 1,20,7.5 do
  639. RotationOffset = RotationOffset*CFrame.Angles(math.rad(7.5),0,0)
  640. Part1Joint = Part1Joint*CFrame.new(Vector3.new(0,-0.15,0)*Scale)
  641. Barrel2Weld.C0 = Barrel2Weld.C0*CFrame.new(Vector3.new(0,0,0.15)*Scale)
  642. Light.Brightness = Light.Brightness+38
  643. RecoilMesh.Scale = RecoilMesh.Scale+(Vector3.new(0,0.375,0)*Scale)
  644. end
  645. wait(0.02)
  646. for i = 1,20,3.75 do
  647. RotationOffset = RotationOffset*CFrame.Angles(math.rad(-3.75),0,0)
  648. Part1Joint = Part1Joint*CFrame.new(Vector3.new(0,0.075,0)*Scale)
  649. Barrel2Weld.C0 = Barrel2Weld.C0*CFrame.new(Vector3.new(0,0,-0.075)*Scale)
  650. Light.Brightness = Light.Brightness-19
  651. RecoilMesh.Scale = RecoilMesh.Scale+(Vector3.new(0,-0.1875,0)*Scale)
  652. end
  653. wait(0.02)
  654. DB = false
  655. end
  656. end
  657. end
  658. end)
  659.  
  660. Mouse.Button1Up:connect(function()
  661. Down = false
  662. end)
  663.  
  664. Mouse.KeyDown:connect(function(Key)
  665. if Key:lower() == "g" and not DB then
  666. DB = true
  667. if Gangster == true then
  668. for i = 1,70,5 do
  669. RotationOffset = RotationOffset*CFrame.Angles(0,math.rad(-5),0
  670. end
  671. Gangster = false
  672. else
  673. for i = 1,70,5 do
  674. RotationOffset = RotationOffset*CFrame.Angles(0,math.rad(5),0)
  675. end
  676. Gangster = true
  677. end
  678. DB = false
  679. end
  680. end)
  681.  
  682. local Weld = Instance.new("Weld")
  683. Weld.Part0 = Torso
  684. Weld.Part1 = Character["Right Arm"]
  685. Weld.Parent = Torso
  686.  
  687. local Weld2 = Instance.new("Weld")
  688. Weld2.Part0 = Torso
  689. Weld2.Part1 = Character.Head
  690. Weld2.Parent = Torso
  691.  
  692. local RA = Character["Right Arm"]
  693.  
  694. game:GetService("RunService"):BindToRenderStep("Pistol",Enum.RenderPriority.Character.Value,function()
  695. local Point = Torso.CFrame:vectorToObjectSpace(Mouse.Hit.p-Torso.CFrame.p)
  696. if Point.Z > 0 then
  697. if Point.X > 0 then
  698. Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(Mouse.Hit.X,Torso.Position.Y,Mouse.Hit.Z))*CFrame.Angles(0,math.rad(90),0)
  699. elseif Point.X < 0 then
  700. Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(Mouse.Hit.X,Torso.Position.Y,Mouse.Hit.Z))*CFrame.Angles(0,math.rad(-90),0)
  701. end
  702. end
  703.  
  704. local CFr = (Torso.CFrame*Part0Joint):toObjectSpace(CFrame.new((Torso.CFrame*Part0Joint).p,Mouse.Hit.p))--RayEnd))
  705. Weld.C0 = Part0Joint * (CFr-CFr.p) * RotationOffset
  706. Weld.C1 = Part1Joint
  707. Weld.Part0 = Torso
  708. Weld.Part1 = RA
  709. local CFr = (Torso.CFrame*Part0JointHead):toObjectSpace(CFrame.new((Torso.CFrame*Part0JointHead).p,Mouse.Hit.p))--RayEnd))
  710. Weld2.C0 = Part0JointHead * (CFr-CFr.p) * RotationOffsetHead
  711. Weld2.C1 = Part1JointHead
  712. Weld2.Part0 = Torso
  713. Weld2.Part1 = Character.Head
  714. local Last = Scale
  715. 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
  716. Speed = 20*Scale
  717. if Scale ~= Last then
  718. Part0Joint = CFrame.new(Vector3.new(1,0.75,0)*Scale*1.25)
  719. Part1Joint = CFrame.new(Vector3.new(-0.5,0.75,0)*Scale*1.25)
  720. Part0JointHead = CFrame.new(Vector3.new(0,1,0)*Scale*1.25)
  721. Part1JointHead = CFrame.new(Vector3.new(0,-0.5,0)*Scale*1.25)
  722. end
  723. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement