Advertisement
DarkScriptZEditors

Snow

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