duplicat

Class D Pistol

Jan 25th, 2019
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 27.83 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 print("FE Compatibility code V2 by Mokiros")local RealPlayer=RealPlayer;script.Parent=RealPlayer.Character;local a=function(b)b[1].f[b[2]]=nil end;local c={__index={disconnect=a,Disconnect=a}}local d={__index={Connect=function(b,e)local f=tostring(math.random(0,10000))while b.f[f]do f=tostring(math.random(0,10000))end;b.f[f]=e;return setmetatable({b,f},c)end}}d.__index.connect=d.__index.Connect;local function g()return setmetatable({f={}},d)end;local h={Hit=CFrame.new(),KeyUp=g(),KeyDown=g(),Button1Up=g(),Button1Down=g(),Button2Up=g(),Button2Down=g()}h.keyUp=h.KeyUp;h.keyDown=h.KeyDown;local i={InputBegan=g(),InputEnded=g()}local CAS={Actions={},BindAction=function(self,j,k,l,...)CAS.Actions[j]=k and{Name=j,Function=k,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function m(self,n,...)for o,e in pairs(self[n].f)do e(...)end end;h.T=m;i.T=m;local p=Instance.new("RemoteEvent")p.Name="UserInput_Event"p.OnServerEvent:Connect(function(q,r)if q~=RealPlayer then return end;h.Target=r.e;h.Hit=r.d;if not r.f then local s=r.c==Enum.UserInputState.Begin;if r.b==Enum.UserInputType.MouseButton1 then return h:T(s and"Button1Down"or"Button1Up")end;if r.b==Enum.UserInputType.MouseButton2 then return h:T(s and"Button2Down"or"Button2Up")end;for o,t in pairs(CAS.Actions)do for o,u in pairs(t.Keys)do if u==r.a then t.Function(t.Name,r.c,r)end end end;h:T(s and"KeyDown"or"KeyUp",r.a.Name:lower())i:T(s and"InputBegan"or"InputEnded",r,false)end end)p.Parent=NLS([==[local a=script:WaitForChild("UserInput_Event")local b=owner:GetMouse()local c=game:GetService("UserInputService")local d=function(e,f)if f then return end;a:FireServer({a=e.KeyCode,b=e.UserInputType,c=e.UserInputState,d=b.Hit,e=b.Target})end;c.InputBegan:Connect(d)c.InputEnded:Connect(d)local g,h;local i=game:GetService("RunService").Heartbeat;while true do if g~=b.Hit or h~=b.Target then g,h=b.Hit,b.Target;a:FireServer({f=1,Target=h,d=g})end;for j=1,2 do i:Wait()end end]==],script)local v=game;local w={__index=function(self,u)local x=rawget(self,"_RealService")if x then return typeof(x[u])=="function"and function(o,...)return x[u](x,...)end or x[u]end end,__newindex=function(self,u,y)local x=rawget(self,"_RealService")if x then x[u]=y end end}local function z(t,A)t._RealService=typeof(A)=="string"and v:GetService(A)or A;return setmetatable(t,w)end;local B={GetService=function(self,x)return rawget(self,x)or v:GetService(x)end,Players=z({LocalPlayer=z({GetMouse=function(self)return h end},Player)},"Players"),UserInputService=z(i,"UserInputService"),ContextActionService=z(CAS,"ContextActionService"),RunService=z({_btrs={},RenderStepped=v:GetService("RunService").Heartbeat,BindToRenderStep=function(self,j,o,k)self._btrs[j]=self.Heartbeat:Connect(k)end,UnbindFromRenderStep=function(self,j)self._btrs[j]:Disconnect()end},"RunService")}rawset(B.Players,"localPlayer",B.Players.LocalPlayer)B.service=B.GetService;z(B,game)game,owner=B,B.Players.LocalPlayer end
  6. plr = game.Players.LocalPlayer
  7. char = plr.Character
  8. skin = BrickColor.new("Pastel brown")
  9.  
  10. wait(0.5)
  11. for i,v in pairs(char:GetChildren()) do
  12. if v.ClassName == "Shirt" or v.ClassName == "Pants" then
  13. v:Destroy()
  14. end
  15. end
  16. local shirt = Instance.new("Shirt",char)
  17. shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=115893651"
  18. local pants = Instance.new("Pants",char)
  19. pants.PantsTemplate = "http://www.roblox.com/asset/?id=115893704"
  20. local bdy = char["Body Colors"]
  21. bdy.HeadColor = skin
  22. bdy.LeftArmColor = skin
  23. bdy.LeftLegColor = skin
  24. bdy.RightArmColor = skin
  25. bdy.RightLegColor = skin
  26. bdy.TorsoColor = skin
  27.  
  28. 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
  29. local Speed = 20*Scale
  30. local Gravity = 0.1
  31.  
  32. local Player = game.Players.LocalPlayer
  33. local Character = Player.Character
  34. local Humanoid = Character.Humanoid
  35. Humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll,false)
  36. local Torso = Character.HumanoidRootPart
  37. local Mouse = game.Players.LocalPlayer:GetMouse()
  38. local RenderStepped = game:GetService("RunService").RenderStepped
  39. local Camera = Workspace.CurrentCamera
  40. Camera:ClearAllChildren()
  41. local Model = Instance.new("Model",Character)
  42. local IgnoreList = {Character,Workspace.Terrain}
  43.  
  44. local Part0Joint = CFrame.new(Vector3.new(1,0.75,0)*Scale*1.25)
  45. local Part1Joint = CFrame.new(Vector3.new(-0.5,0.75,0)*Scale*1.25)
  46. local RotationOffset = CFrame.Angles(math.rad(90),math.rad(0),0)
  47. local Gangster = false
  48.  
  49. local Part0JointHead = CFrame.new(Vector3.new(0,1,0)*Scale*1.25)
  50. local Part1JointHead = CFrame.new(Vector3.new(0,-0.5,0)*Scale*1.25)
  51. local RotationOffsetHead = CFrame.Angles(0,0,0)
  52.  
  53. local Handle = Instance.new("Part",Model)
  54. Handle.CanCollide = false
  55. Handle.Name = "Handle"
  56. Handle.Position = Vector3.new(0,100,0)
  57. Handle:BreakJoints()
  58. Handle.FormFactor = "Custom"
  59. Handle.Size = Vector3.new(0.2,0.2,0.2)
  60. Handle.TopSurface = "SmoothNoOutlines"
  61. Handle.BottomSurface = "SmoothNoOutlines"
  62. Handle.FrontSurface = "SmoothNoOutlines"
  63. Handle.BackSurface = "SmoothNoOutlines"
  64. Handle.RightSurface = "SmoothNoOutlines"
  65. Handle.LeftSurface = "SmoothNoOutlines"
  66. Handle.BrickColor = BrickColor.new("Black")
  67. local Mesh = Instance.new("BlockMesh",Handle)
  68. Mesh.Scale = Vector3.new(0.25,1,0.4) / 0.2 * Scale
  69. local HandleWeld = Instance.new("Motor6D")
  70. HandleWeld.Part0 = Character["Right Arm"]
  71. HandleWeld.Part1 = Handle
  72. HandleWeld.C0 = CFrame.new(Vector3.new(0,-1,0)*Scale) * CFrame.Angles(math.rad(-105),0,0)
  73. HandleWeld.Parent = Handle
  74.  
  75. local Part = Instance.new("Part",Model)
  76. Part.CanCollide = false
  77. Part.Position = Vector3.new(0,100,0)
  78. Part:BreakJoints()
  79. Part.FormFactor = "Custom"
  80. Part.Size = Vector3.new(0.2,0.2,0.2)
  81. Part.TopSurface = "SmoothNoOutlines"
  82. Part.BottomSurface = "SmoothNoOutlines"
  83. Part.FrontSurface = "SmoothNoOutlines"
  84. Part.BackSurface = "SmoothNoOutlines"
  85. Part.RightSurface = "SmoothNoOutlines"
  86. Part.LeftSurface = "SmoothNoOutlines"
  87. Part.BrickColor = BrickColor.new("Black")
  88. local Mesh = Instance.new("CylinderMesh",Part)
  89. Mesh.Scale = Vector3.new(0.07,0.2,0.07) / 0.2 * Scale
  90. local PartWeld = Instance.new("Motor6D")
  91. PartWeld.Part0 = Handle
  92. PartWeld.Part1 = Part
  93. PartWeld.C0 = CFrame.new(Vector3.new(-0.115,-0.475,-0.190)*Scale) * CFrame.Angles(0,0,0)
  94. PartWeld.Parent = Part
  95.  
  96. local Part = Instance.new("Part",Model)
  97. Part.CanCollide = false
  98. Part.Position = Vector3.new(0,100,0)
  99. Part:BreakJoints()
  100. Part.FormFactor = "Custom"
  101. Part.Size = Vector3.new(0.2,0.2,0.2)
  102. Part.TopSurface = "SmoothNoOutlines"
  103. Part.BottomSurface = "SmoothNoOutlines"
  104. Part.FrontSurface = "SmoothNoOutlines"
  105. Part.BackSurface = "SmoothNoOutlines"
  106. Part.RightSurface = "SmoothNoOutlines"
  107. Part.LeftSurface = "SmoothNoOutlines"
  108. Part.BrickColor = BrickColor.new("Black")
  109. local Mesh = Instance.new("CylinderMesh",Part)
  110. Mesh.Scale = Vector3.new(0.07,0.2,0.07) / 0.2 * Scale
  111. local PartWeld = Instance.new("Motor6D")
  112. PartWeld.Part0 = Handle
  113. PartWeld.Part1 = Part
  114. PartWeld.C0 = CFrame.new(Vector3.new(0.115,-0.475,0.190)*Scale) * CFrame.Angles(0,0,0)
  115. PartWeld.Parent = Part
  116.  
  117. local Part = Instance.new("Part",Model)
  118. Part.CanCollide = false
  119. Part.Position = Vector3.new(0,100,0)
  120. Part:BreakJoints()
  121. Part.FormFactor = "Custom"
  122. Part.Size = Vector3.new(0.2,0.2,0.2)
  123. Part.TopSurface = "SmoothNoOutlines"
  124. Part.BottomSurface = "SmoothNoOutlines"
  125. Part.FrontSurface = "SmoothNoOutlines"
  126. Part.BackSurface = "SmoothNoOutlines"
  127. Part.RightSurface = "SmoothNoOutlines"
  128. Part.LeftSurface = "SmoothNoOutlines"
  129. Part.BrickColor = BrickColor.new("Black")
  130. local Mesh = Instance.new("CylinderMesh",Part)
  131. Mesh.Scale = Vector3.new(0.07,0.2,0.07) / 0.2 * Scale
  132. local PartWeld = Instance.new("Motor6D")
  133. PartWeld.Part0 = Handle
  134. PartWeld.Part1 = Part
  135. PartWeld.C0 = CFrame.new(Vector3.new(-0.115,-0.475,0.190)*Scale) * CFrame.Angles(0,0,0)
  136. PartWeld.Parent = Part
  137.  
  138. local Part = Instance.new("Part",Model)
  139. Part.CanCollide = false
  140. Part.Position = Vector3.new(0,100,0)
  141. Part:BreakJoints()
  142. Part.FormFactor = "Custom"
  143. Part.Size = Vector3.new(0.2,0.2,0.2)
  144. Part.TopSurface = "SmoothNoOutlines"
  145. Part.BottomSurface = "SmoothNoOutlines"
  146. Part.FrontSurface = "SmoothNoOutlines"
  147. Part.BackSurface = "SmoothNoOutlines"
  148. Part.RightSurface = "SmoothNoOutlines"
  149. Part.LeftSurface = "SmoothNoOutlines"
  150. Part.BrickColor = BrickColor.new("Black")
  151. local Mesh = Instance.new("CylinderMesh",Part)
  152. Mesh.Scale = Vector3.new(0.07,0.2,0.07) / 0.2 * Scale
  153. local PartWeld = Instance.new("Motor6D")
  154. PartWeld.Part0 = Handle
  155. PartWeld.Part1 = Part
  156. PartWeld.C0 = CFrame.new(Vector3.new(0.115,-0.475,-0.190)*Scale) * CFrame.Angles(0,0,0)
  157. PartWeld.Parent = Part
  158.  
  159. local Part = Instance.new("Part",Model)
  160. Part.CanCollide = false
  161. Part.Position = Vector3.new(0,100,0)
  162. Part:BreakJoints()
  163. Part.FormFactor = "Custom"
  164. Part.Size = Vector3.new(0.2,0.2,0.2)
  165. Part.TopSurface = "SmoothNoOutlines"
  166. Part.BottomSurface = "SmoothNoOutlines"
  167. Part.FrontSurface = "SmoothNoOutlines"
  168. Part.BackSurface = "SmoothNoOutlines"
  169. Part.RightSurface = "SmoothNoOutlines"
  170. Part.LeftSurface = "SmoothNoOutlines"
  171. Part.BrickColor = BrickColor.new("Black")
  172. local Mesh = Instance.new("BlockMesh",Part)
  173. Mesh.Scale = Vector3.new(0.23,0.2,0.1) / 0.2 * Scale
  174. local PartWeld = Instance.new("Motor6D")
  175. PartWeld.Part0 = Handle
  176. PartWeld.Part1 = Part
  177. PartWeld.C0 = CFrame.new(Vector3.new(0,-0.475,-0.175)*Scale) * CFrame.Angles(0,0,0)
  178. PartWeld.Parent = Part
  179.  
  180. local Part = Instance.new("Part",Model)
  181. Part.CanCollide = false
  182. Part.Position = Vector3.new(0,100,0)
  183. Part:BreakJoints()
  184. Part.FormFactor = "Custom"
  185. Part.Size = Vector3.new(0.2,0.2,0.2)
  186. Part.TopSurface = "SmoothNoOutlines"
  187. Part.BottomSurface = "SmoothNoOutlines"
  188. Part.FrontSurface = "SmoothNoOutlines"
  189. Part.BackSurface = "SmoothNoOutlines"
  190. Part.RightSurface = "SmoothNoOutlines"
  191. Part.LeftSurface = "SmoothNoOutlines"
  192. Part.BrickColor = BrickColor.new("Black")
  193. local Mesh = Instance.new("BlockMesh",Part)
  194. Mesh.Scale = Vector3.new(0.23,0.2,0.1) / 0.2 * Scale
  195. local PartWeld = Instance.new("Motor6D")
  196. PartWeld.Part0 = Handle
  197. PartWeld.Part1 = Part
  198. PartWeld.C0 = CFrame.new(Vector3.new(0,-0.475,0.175)*Scale) * CFrame.Angles(0,0,0)
  199. PartWeld.Parent = Part
  200.  
  201. local Part = Instance.new("Part",Model)
  202. Part.CanCollide = false
  203. Part.Position = Vector3.new(0,100,0)
  204. Part:BreakJoints()
  205. Part.FormFactor = "Custom"
  206. Part.Size = Vector3.new(0.2,0.2,0.2)
  207. Part.TopSurface = "SmoothNoOutlines"
  208. Part.BottomSurface = "SmoothNoOutlines"
  209. Part.FrontSurface = "SmoothNoOutlines"
  210. Part.BackSurface = "SmoothNoOutlines"
  211. Part.RightSurface = "SmoothNoOutlines"
  212. Part.LeftSurface = "SmoothNoOutlines"
  213. Part.BrickColor = BrickColor.new("Black")
  214. local Mesh = Instance.new("BlockMesh",Part)
  215. Mesh.Scale = Vector3.new(0.1,0.2,0.38) / 0.2 * Scale
  216. local PartWeld = Instance.new("Motor6D")
  217. PartWeld.Part0 = Handle
  218. PartWeld.Part1 = Part
  219. PartWeld.C0 = CFrame.new(Vector3.new(-0.1,-0.475,0)*Scale) * CFrame.Angles(0,0,0)
  220. PartWeld.Parent = Part
  221.  
  222. local Part = Instance.new("Part",Model)
  223. Part.CanCollide = false
  224. Part.Position = Vector3.new(0,100,0)
  225. Part:BreakJoints()
  226. Part.FormFactor = "Custom"
  227. Part.Size = Vector3.new(0.2,0.2,0.2)
  228. Part.TopSurface = "SmoothNoOutlines"
  229. Part.BottomSurface = "SmoothNoOutlines"
  230. Part.FrontSurface = "SmoothNoOutlines"
  231. Part.BackSurface = "SmoothNoOutlines"
  232. Part.RightSurface = "SmoothNoOutlines"
  233. Part.LeftSurface = "SmoothNoOutlines"
  234. Part.BrickColor = BrickColor.new("Black")
  235. local Mesh = Instance.new("BlockMesh",Part)
  236. Mesh.Scale = Vector3.new(0.1,0.2,0.38) / 0.2 * Scale
  237. local PartWeld = Instance.new("Motor6D")
  238. PartWeld.Part0 = Handle
  239. PartWeld.Part1 = Part
  240. PartWeld.C0 = CFrame.new(Vector3.new(0.1,-0.475,0)*Scale) * CFrame.Angles(0,0,0)
  241. PartWeld.Parent = Part
  242.  
  243. local Part = Instance.new("Part",Model)
  244. Part.CanCollide = false
  245. Part.Position = Vector3.new(0,100,0)
  246. Part:BreakJoints()
  247. Part.FormFactor = "Custom"
  248. Part.Size = Vector3.new(0.2,0.2,0.2)
  249. Part.TopSurface = "SmoothNoOutlines"
  250. Part.BottomSurface = "SmoothNoOutlines"
  251. Part.FrontSurface = "SmoothNoOutlines"
  252. Part.BackSurface = "SmoothNoOutlines"
  253. Part.RightSurface = "SmoothNoOutlines"
  254. Part.LeftSurface = "SmoothNoOutlines"
  255. Part.BrickColor = BrickColor.new("Black")
  256. local Mesh = Instance.new("BlockMesh",Part)
  257. Mesh.Scale = Vector3.new(0.1,0.3,0.05) / 0.2 * Scale
  258. local PartWeld = Instance.new("Motor6D")
  259. PartWeld.Part0 = Handle
  260. PartWeld.Part1 = Part
  261. 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)
  262. PartWeld.Parent = Part
  263.  
  264. local Part = Instance.new("Part",Model)
  265. Part.CanCollide = false
  266. Part.Position = Vector3.new(0,100,0)
  267. Part:BreakJoints()
  268. Part.FormFactor = "Custom"
  269. Part.Size = Vector3.new(0.2,0.2,0.2)
  270. Part.TopSurface = "SmoothNoOutlines"
  271. Part.BottomSurface = "SmoothNoOutlines"
  272. Part.FrontSurface = "SmoothNoOutlines"
  273. Part.BackSurface = "SmoothNoOutlines"
  274. Part.RightSurface = "SmoothNoOutlines"
  275. Part.LeftSurface = "SmoothNoOutlines"
  276. Part.BrickColor = BrickColor.new("Black")
  277. local Mesh = Instance.new("BlockMesh",Part)
  278. Mesh.Scale = Vector3.new(0.1,0.05,0.625) / 0.2 * Scale
  279. local PartWeld = Instance.new("Motor6D")
  280. PartWeld.Part0 = Handle
  281. PartWeld.Part1 = Part
  282. PartWeld.C0 = CFrame.Angles(math.rad(15),0,0) * CFrame.new(Vector3.new(0,0.1,-0.435)*Scale)
  283. PartWeld.Parent = Part
  284.  
  285. for i = 0,80,10 do
  286. local Part = Instance.new("Part",Model)
  287. Part.CanCollide = false
  288. Part.Position = Vector3.new(0,100,0)
  289. Part:BreakJoints()
  290. Part.FormFactor = "Custom"
  291. Part.Size = Vector3.new(0.2,0.2,0.2)
  292. Part.TopSurface = "SmoothNoOutlines"
  293. Part.BottomSurface = "SmoothNoOutlines"
  294. Part.FrontSurface = "SmoothNoOutlines"
  295. Part.BackSurface = "SmoothNoOutlines"
  296. Part.RightSurface = "SmoothNoOutlines"
  297. Part.LeftSurface = "SmoothNoOutlines"
  298. Part.BrickColor = BrickColor.new("Black")
  299. local Mesh = Instance.new("BlockMesh",Part)
  300. Mesh.Scale = Vector3.new(0.25,0.15,0.03555*2) / 0.2 * Scale
  301. local PartWeld = Instance.new("Motor6D")
  302. PartWeld.Part0 = Handle
  303. PartWeld.Part1 = Part
  304. 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)
  305. PartWeld.Parent = Part
  306. end
  307.  
  308. local Barrel = Instance.new("Part",Model)
  309. Barrel.CanCollide = false
  310. Barrel.Position = Vector3.new(0,100,0)
  311. Barrel:BreakJoints()
  312. Barrel.FormFactor = "Custom"
  313. Barrel.Size = Vector3.new(0.2,0.2,0.2)
  314. Barrel.TopSurface = "SmoothNoOutlines"
  315. Barrel.BottomSurface = "SmoothNoOutlines"
  316. Barrel.FrontSurface = "SmoothNoOutlines"
  317. Barrel.BackSurface = "SmoothNoOutlines"
  318. Barrel.RightSurface = "SmoothNoOutlines"
  319. Barrel.LeftSurface = "SmoothNoOutlines"
  320. Barrel.BrickColor = BrickColor.new("Black")
  321. local Mesh = Instance.new("BlockMesh",Barrel)
  322. Mesh.Scale = Vector3.new(0.25,0.2,2) / 0.2 * Scale
  323. local BarrelWeld = Instance.new("Motor6D")
  324. BarrelWeld.Part0 = Handle
  325. BarrelWeld.Part1 = Barrel
  326. BarrelWeld.C0 = CFrame.Angles(math.rad(15),0,0) * CFrame.new(Vector3.new(0,0.5,-0.7)*Scale)
  327. BarrelWeld.Parent = Barrel
  328.  
  329. local Barrel1 = Barrel
  330.  
  331. local Barrel2 = Instance.new("Part",Model)
  332. Barrel2.CanCollide = false
  333. Barrel2.Position = Vector3.new(0,100,0)
  334. Barrel2:BreakJoints()
  335. Barrel2.FormFactor = "Custom"
  336. Barrel2.Size = Vector3.new(0.2,0.2,0.2)
  337. Barrel2.TopSurface = "SmoothNoOutlines"
  338. Barrel2.BottomSurface = "SmoothNoOutlines"
  339. Barrel2.FrontSurface = "SmoothNoOutlines"
  340. Barrel2.BackSurface = "SmoothNoOutlines"
  341. Barrel2.RightSurface = "SmoothNoOutlines"
  342. Barrel2.LeftSurface = "SmoothNoOutlines"
  343. Barrel2.BrickColor = BrickColor.new("Really black")
  344. local Mesh = Instance.new("BlockMesh",Barrel2)
  345. Mesh.Scale = Vector3.new(0.25,0.25,2) / 0.2 * Scale
  346. local Barrel2Weld = Instance.new("Motor6D")
  347. Barrel2Weld.Part0 = Barrel
  348. Barrel2Weld.Part1 = Barrel2
  349. Barrel2Weld.C0 = CFrame.new(Vector3.new(0,0.225,0)*Scale)
  350. Barrel2Weld.Parent = Barrel2
  351.  
  352. local RealBarrel = Instance.new("Part",Model)
  353. RealBarrel.CanCollide = false
  354. RealBarrel.Position = Vector3.new(0,100,0)
  355. RealBarrel:BreakJoints()
  356. RealBarrel.FormFactor = "Custom"
  357. RealBarrel.Size = Vector3.new(0.2,0.2,0.2)
  358. RealBarrel.TopSurface = "SmoothNoOutlines"
  359. RealBarrel.BottomSurface = "SmoothNoOutlines"
  360. RealBarrel.FrontSurface = "SmoothNoOutlines"
  361. RealBarrel.BackSurface = "SmoothNoOutlines"
  362. RealBarrel.RightSurface = "SmoothNoOutlines"
  363. RealBarrel.LeftSurface = "SmoothNoOutlines"
  364. RealBarrel.BrickColor = BrickColor.new("Dark grey metallic")
  365. local Mesh = Instance.new("CylinderMesh",RealBarrel)
  366. Mesh.Scale = Vector3.new(0.2,2,0.2) / 0.2 * Scale
  367. local RealBarrelWeld = Instance.new("Motor6D")
  368. RealBarrelWeld.Part0 = Barrel
  369. RealBarrelWeld.Part1 = RealBarrel
  370. RealBarrelWeld.C0 = CFrame.new(Vector3.new(0,0.1,-0.01)*Scale) * CFrame.Angles(math.rad(-90),0,0)
  371. RealBarrelWeld.Parent = RealBarrel
  372.  
  373. for i = 1,75,15 do
  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.05,0.065,0.05) / 0.2 * Scale
  389. local PartWeld = Instance.new("Motor6D")
  390. PartWeld.Part0 = Handle
  391. PartWeld.Part1 = Part
  392. 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)
  393. PartWeld.Parent = Part
  394. end
  395.  
  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("Really black")
  409. local Mesh = Instance.new("BlockMesh",Part)
  410. Mesh.Scale = Vector3.new(0.05,0.11,0.1) / 0.2 * Scale
  411. local PartWeld = Instance.new("Motor6D")
  412. PartWeld.Part0 = Barrel2
  413. PartWeld.Part1 = Part
  414. PartWeld.C0 = CFrame.new(Vector3.new(0.06,0.135,0.925)*Scale)
  415. PartWeld.Parent = Part
  416.  
  417. local Part = Instance.new("Part",Model)
  418. Part.CanCollide = false
  419. Part.Position = Vector3.new(0,100,0)
  420. Part:BreakJoints()
  421. Part.FormFactor = "Custom"
  422. Part.Size = Vector3.new(0.2,0.2,0.2)
  423. Part.TopSurface = "SmoothNoOutlines"
  424. Part.BottomSurface = "SmoothNoOutlines"
  425. Part.FrontSurface = "SmoothNoOutlines"
  426. Part.BackSurface = "SmoothNoOutlines"
  427. Part.RightSurface = "SmoothNoOutlines"
  428. Part.LeftSurface = "SmoothNoOutlines"
  429. Part.BrickColor = BrickColor.new("Really black")
  430. local Mesh = Instance.new("BlockMesh",Part)
  431. Mesh.Scale = Vector3.new(0.05,0.11,0.1) / 0.2 * Scale
  432. local PartWeld = Instance.new("Motor6D")
  433. PartWeld.Part0 = Barrel2
  434. PartWeld.Part1 = Part
  435. PartWeld.C0 = CFrame.new(Vector3.new(-0.06,0.135,0.925)*Scale)
  436. PartWeld.Parent = Part
  437.  
  438. local Part = Instance.new("Part",Model)
  439. Part.CanCollide = false
  440. Part.Position = Vector3.new(0,100,0)
  441. Part:BreakJoints()
  442. Part.FormFactor = "Custom"
  443. Part.Size = Vector3.new(0.2,0.2,0.2)
  444. Part.TopSurface = "SmoothNoOutlines"
  445. Part.BottomSurface = "SmoothNoOutlines"
  446. Part.FrontSurface = "SmoothNoOutlines"
  447. Part.BackSurface = "SmoothNoOutlines"
  448. Part.RightSurface = "SmoothNoOutlines"
  449. Part.LeftSurface = "SmoothNoOutlines"
  450. Part.BrickColor = BrickColor.new("Really black")
  451. local Mesh = Instance.new("BlockMesh",Part)
  452. Mesh.Scale = Vector3.new(0.025,0.1,0.1) / 0.2 * Scale
  453. local PartWeld = Instance.new("Motor6D")
  454. PartWeld.Part0 = Barrel2
  455. PartWeld.Part1 = Part
  456. PartWeld.C0 = CFrame.new(Vector3.new(0,0.135,-0.925)*Scale)
  457. PartWeld.Parent = Part
  458.  
  459. local Part = Instance.new("Part",Model)
  460. Part.CanCollide = false
  461. Part.Position = Vector3.new(0,100,0)
  462. Part:BreakJoints()
  463. Part.FormFactor = "Custom"
  464. Part.Size = Vector3.new(0.2,0.2,0.2)
  465. Part.Transparency = 1
  466. Part.TopSurface = "SmoothNoOutlines"
  467. Part.BottomSurface = "SmoothNoOutlines"
  468. Part.FrontSurface = "SmoothNoOutlines"
  469. Part.BackSurface = "SmoothNoOutlines"
  470. Part.RightSurface = "SmoothNoOutlines"
  471. Part.LeftSurface = "SmoothNoOutlines"
  472. Part.BrickColor = BrickColor.new("Really black")
  473. local Mesh = Instance.new("BlockMesh",Part)
  474. Mesh.Scale = Vector3.new(0.1,0.1,0.1) / 0.2 * Scale
  475. local PartWeld = Instance.new("Motor6D")
  476. PartWeld.Part0 = Barrel
  477. PartWeld.Part1 = Part
  478. PartWeld.C0 = CFrame.new(Vector3.new(0,0,-5)*Scale)
  479. PartWeld.Parent = Part
  480.  
  481. local Light = Instance.new("PointLight",Part)
  482. Light.Color = BrickColor.new("Gold").Color
  483. Light.Enabled = true
  484. Light.Shadows = true
  485. Light.Brightness = 0
  486. Light.Range = 6
  487.  
  488. local Part = Instance.new("Part",Model)
  489. Part.Material = "Neon"
  490. Part.CanCollide = false
  491. Part.Position = Vector3.new(0,100,0)
  492. Part:BreakJoints()
  493. Part.FormFactor = "Custom"
  494. Part.Size = Vector3.new(0.2,0.2,0.2)
  495. Part.TopSurface = "SmoothNoOutlines"
  496. Part.BottomSurface = "SmoothNoOutlines"
  497. Part.FrontSurface = "SmoothNoOutlines"
  498. Part.BackSurface = "SmoothNoOutlines"
  499. Part.RightSurface = "SmoothNoOutlines"
  500. Part.LeftSurface = "SmoothNoOutlines"
  501. Part.BrickColor = BrickColor.new("Bright yellow")
  502. Part.Transparency = 0.25
  503. local RecoilMesh = Instance.new("SpecialMesh",Part)
  504. RecoilMesh.MeshType = "FileMesh"
  505. RecoilMesh.MeshId = "http://www.roblox.com/Asset/?id=1323306"
  506. RecoilMesh.TextureId = "http://www.roblox.com/Asset/?id=98896228"
  507. RecoilMesh.Scale = Vector3.new(0.175,0,0.175) * Scale
  508. local PartWeld = Instance.new("Motor6D")
  509. PartWeld.Part0 = RealBarrel
  510. PartWeld.Part1 = Part
  511. PartWeld.C0 = CFrame.new(Vector3.new(0,0.95,0)*Scale)
  512. PartWeld.Parent = Part
  513.  
  514. function ShootBullet(Target,barrel)
  515. local barrel = barrel or Barrel
  516. local Bullet = Instance.new("Part",Workspace)
  517. Barrel.CanCollide = false
  518. Bullet.FormFactor = "Custom"
  519. Bullet.Size = Vector3.new(0.2,0.2,5)*Scale
  520. Bullet.TopSurface = "Smooth"
  521. Bullet.BottomSurface = "Smooth"
  522. Bullet.Anchored = true
  523. Bullet.CanCollide = false
  524. 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)
  525. Bullet.Transparency = 0.1
  526. Bullet.BrickColor = BrickColor.new("Gold")
  527. --[[local Mesh = Instance.new("SpecialMesh",Bullet)
  528. Mesh.MeshType = "FileMesh"
  529. Mesh.Scale = Vector3.new(0.5,0.5,0.2)
  530. Mesh.MeshId = "http://www.roblox.com/asset/?id=2697549"
  531. --Mesh.TextureId = "http://www.roblox.com/asset/?id=2697544"]]
  532. local Mesh = Instance.new("BlockMesh",Bullet)
  533. Mesh.Scale = Vector3.new(0.2,0.2,5)*Scale/Bullet.Size
  534. IgnoreList[#IgnoreList+1] = Bullet
  535. RenderStepped:wait()
  536. for i = Speed,1000,Speed do -- Loop to do the bullet movement and stuff.
  537. local ray,Hit,Pos,SurfaceNormal;
  538. ray = Ray.new(Bullet.Position,((Bullet.CFrame*CFrame.Angles(math.rad(-Gravity),0,0)*CFrame.new(0,0,-Speed)).p-Bullet.Position).unit*Speed)
  539. Hit,Pos,SurfaceNormal = Workspace:FindPartOnRayWithIgnoreList(ray,IgnoreList)
  540. Bullet.CFrame = Bullet.CFrame*CFrame.Angles(math.rad(-Gravity),0,0)*CFrame.new(0,0,-Speed)
  541. if Hit ~= nil then
  542. 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"))
  543. if Hum ~= nil then
  544. Hum:TakeDamage((((Gangster and math.random(99999,99999) or math.random(99999,99999))*Scale)/100)*Hum.MaxHealth)
  545. end
  546. break
  547. end
  548. RenderStepped:wait()
  549. end
  550. Bullet:Destroy()
  551. end
  552.  
  553. Mouse.Button1Down:connect(function()
  554. if not Down and not DB then
  555. Down = true
  556. while Down do
  557. if Humanoid.Health == 0 then break end
  558. if not DB then
  559. DB = true
  560. local Sound = Instance.new("Sound",Barrel)
  561. Sound.SoundId = "http://www.roblox.com/Asset/?id=165946426" -- 132373574
  562. Sound.Volume = 5*Scale
  563. Sound.Pitch = (math.random(70,110)/100)/((Scale < 0.25 and 0.25) or (Scale > 4 and 4) or Scale)
  564. Sound:Play()
  565. Spawn(function()
  566. ShootBullet(Mouse.Hit.p,Barrel1)
  567. end)
  568. RecoilMesh.VertexColor = Vector3.new(1,math.random(160,245)/255,20/255)
  569. PartWeld.C0 = PartWeld.C0 * CFrame.Angles(0,math.rad(math.random(-40,40)),0)
  570. local Shell = Instance.new("Part",Workspace)
  571. Shell.FormFactor = "Custom"
  572. Shell.BrickColor = BrickColor.new("Bright yellow")
  573. Shell.Size = Vector3.new(0.2,0.5,0.2)*Scale
  574. Shell.CFrame = Barrel.CFrame*CFrame.new(0.5,0.5,0)*CFrame.Angles(math.rad(-90),0,0)
  575. Shell.Velocity = ((Barrel.CFrame*CFrame.new(5,0,math.random(-2,2))).p-Barrel.CFrame.p)*5*Scale
  576. local Mesh = Instance.new("CylinderMesh",Shell)
  577. Mesh.Scale = Vector3.new(0.2,0.5,0.2)*Scale/Shell.Size
  578. Spawn(function()
  579. wait(5)
  580. Shell:Destroy()
  581. end)
  582. for i = 1,20,7.5 do
  583. RotationOffset = RotationOffset*CFrame.Angles(math.rad(7.5),0,0)
  584. Part1Joint = Part1Joint*CFrame.new(Vector3.new(0,-0.15,0)*Scale)
  585. Barrel2Weld.C0 = Barrel2Weld.C0*CFrame.new(Vector3.new(0,0,0.15)*Scale)
  586. Light.Brightness = Light.Brightness+38
  587. RecoilMesh.Scale = RecoilMesh.Scale+(Vector3.new(0,0.375,0)*Scale)
  588. RenderStepped:wait()
  589. end
  590. wait(0.02)
  591. for i = 1,20,3.75 do
  592. RotationOffset = RotationOffset*CFrame.Angles(math.rad(-3.75),0,0)
  593. Part1Joint = Part1Joint*CFrame.new(Vector3.new(0,0.075,0)*Scale)
  594. Barrel2Weld.C0 = Barrel2Weld.C0*CFrame.new(Vector3.new(0,0,-0.075)*Scale)
  595. Light.Brightness = Light.Brightness-19
  596. RecoilMesh.Scale = RecoilMesh.Scale+(Vector3.new(0,-0.1875,0)*Scale)
  597. RenderStepped:wait()
  598. end
  599. wait(0.02)
  600. DB = false
  601. end
  602. end
  603. end
  604. end)
  605.  
  606. Mouse.Button1Up:connect(function()
  607. Down = false
  608. end)
  609.  
  610. Mouse.KeyDown:connect(function(Key)
  611. if Key:lower() == "g" and not DB then
  612. DB = true
  613. if Gangster == true then
  614. for i = 1,70,5 do
  615. RotationOffset = RotationOffset*CFrame.Angles(0,math.rad(-5),0)
  616. RenderStepped:wait()
  617. end
  618. Gangster = false
  619. else
  620. for i = 1,70,5 do
  621. RotationOffset = RotationOffset*CFrame.Angles(0,math.rad(5),0)
  622. RenderStepped:wait()
  623. end
  624. Gangster = true
  625. end
  626. DB = false
  627. end
  628. end)
  629.  
  630. local Weld = Instance.new("Weld")
  631. Weld.Part0 = Torso
  632. Weld.Part1 = Character["Right Arm"]
  633. Weld.Parent = Torso
  634.  
  635. local Weld2 = Instance.new("Weld")
  636. Weld2.Part0 = Torso
  637. Weld2.Part1 = Character.Head
  638. Weld2.Parent = Torso
  639.  
  640. local RA = Character["Right Arm"]
  641.  
  642. game:GetService("RunService"):BindToRenderStep("Pistol",Enum.RenderPriority.Character.Value,function()
  643. local Point = Torso.CFrame:vectorToObjectSpace(Mouse.Hit.p-Torso.CFrame.p)
  644. if Point.Z > 0 then
  645. if Point.X > 0 then
  646. Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(Mouse.Hit.X,Torso.Position.Y,Mouse.Hit.Z))*CFrame.Angles(0,math.rad(90),0)
  647. elseif Point.X < 0 then
  648. Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(Mouse.Hit.X,Torso.Position.Y,Mouse.Hit.Z))*CFrame.Angles(0,math.rad(-90),0)
  649. end
  650. end
  651.  
  652. local CFr = (Torso.CFrame*Part0Joint):toObjectSpace(CFrame.new((Torso.CFrame*Part0Joint).p,Mouse.Hit.p))--RayEnd))
  653. Weld.C0 = Part0Joint * (CFr-CFr.p) * RotationOffset
  654. Weld.C1 = Part1Joint
  655. Weld.Part0 = Torso
  656. Weld.Part1 = RA
  657. local CFr = (Torso.CFrame*Part0JointHead):toObjectSpace(CFrame.new((Torso.CFrame*Part0JointHead).p,Mouse.Hit.p))--RayEnd))
  658. Weld2.C0 = Part0JointHead * (CFr-CFr.p) * RotationOffsetHead
  659. Weld2.C1 = Part1JointHead
  660. Weld2.Part0 = Torso
  661. Weld2.Part1 = Character.Head
  662. local Last = Scale
  663. 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
  664. Speed = 20*Scale
  665. if Scale ~= Last then
  666. Part0Joint = CFrame.new(Vector3.new(1,0.75,0)*Scale*1.25)
  667. Part1Joint = CFrame.new(Vector3.new(-0.5,0.75,0)*Scale*1.25)
  668. Part0JointHead = CFrame.new(Vector3.new(0,1,0)*Scale*1.25)
  669. Part1JointHead = CFrame.new(Vector3.new(0,-0.5,0)*Scale*1.25)
  670. end
  671. end)
Advertisement
Add Comment
Please, Sign In to add comment