Advertisement
ManOhMan

Untitled

Jun 21st, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 45.23 KB | None | 0 0
  1. --Created with PenguinAnonymous's compiler
  2. --PenguinAnonymous is not responsible for damages caused to your game
  3. --This plugin does not remove things
  4. --PenguinAnonymous cannot be held resonsible for manual deletion for the purpose of testing
  5. --Keep in mind, any items that cause errors in compilation will be skipped and documented within the last line of the disclaimer comments
  6. --Thank you for using my plugin and enjoy :)
  7. --It is free to use
  8. --If you use this plugin to create your own, please give me credit
  9. --Z_V edited my plugin to look like his own and published it without giving me credit, and that makes me very angry
  10. --Errors: UnionOperation,ModuleScript
  11. local runDummyScript = function(f,scri)
  12. local oldenv = getfenv(f)
  13. local newenv = setmetatable({}, {
  14. __index = function(_, k)
  15. if k:lower() == 'script' then
  16. return scri
  17. else
  18. return oldenv[k]
  19. end
  20. end
  21. })
  22. setfenv(f, newenv)
  23. ypcall(function() f() end)
  24. end
  25. cors = {}
  26. mas = Instance.new("Model",game:GetService("Lighting"))
  27. mas.Name = "CompiledModel"
  28. o1 = Instance.new("Part")
  29. o2 = Instance.new("Part")
  30. o3 = Instance.new("Part")
  31. o4 = Instance.new("Part")
  32. o6 = Instance.new("WedgePart")
  33. o7 = Instance.new("WedgePart")
  34. o8 = Instance.new("WedgePart")
  35. o9 = Instance.new("WedgePart")
  36. o10 = Instance.new("Part")
  37. o11 = Instance.new("Part")
  38. o12 = Instance.new("Part")
  39. o13 = Instance.new("Part")
  40. o14 = Instance.new("Part")
  41. o15 = Instance.new("Part")
  42. o16 = Instance.new("Model")
  43. o17 = Instance.new("Part")
  44. o18 = Instance.new("Part")
  45. o19 = Instance.new("Part")
  46. o20 = Instance.new("Part")
  47. o21 = Instance.new("Part")
  48. o22 = Instance.new("Part")
  49. o23 = Instance.new("Part")
  50. o24 = Instance.new("Part")
  51. o25 = Instance.new("Part")
  52. o26 = Instance.new("Part")
  53. o27 = Instance.new("Part")
  54. o28 = Instance.new("Part")
  55. o29 = Instance.new("Part")
  56. o30 = Instance.new("Part")
  57. o31 = Instance.new("Part")
  58. o32 = Instance.new("Part")
  59. o33 = Instance.new("Part")
  60. o34 = Instance.new("Part")
  61. o35 = Instance.new("Part")
  62. o36 = Instance.new("Part")
  63. o37 = Instance.new("Part")
  64. o38 = Instance.new("PointLight")
  65. o39 = Instance.new("Tool")
  66. o40 = Instance.new("Configuration")
  67. o41 = Instance.new("IntValue")
  68. o42 = Instance.new("NumberValue")
  69. o43 = Instance.new("NumberValue")
  70. o44 = Instance.new("IntValue")
  71. o45 = Instance.new("NumberValue")
  72. o46 = Instance.new("LocalScript")
  73. o47 = Instance.new("Script")
  74. o48 = Instance.new("Sound")
  75. o49 = Instance.new("Sound")
  76. o50 = Instance.new("Decal")
  77. o52 = Instance.new("Part")
  78. o53 = Instance.new("PointLight")
  79. o54 = Instance.new("Model")
  80. o55 = Instance.new("Part")
  81. o56 = Instance.new("Part")
  82. o57 = Instance.new("ClickDetector")
  83. o58 = Instance.new("Script")
  84. o59 = Instance.new("Decal")
  85. o60 = Instance.new("Part")
  86. o61 = Instance.new("ClickDetector")
  87. o62 = Instance.new("Script")
  88. o63 = Instance.new("Decal")
  89. o64 = Instance.new("Part")
  90. o65 = Instance.new("ClickDetector")
  91. o66 = Instance.new("Script")
  92. o67 = Instance.new("Decal")
  93. o68 = Instance.new("Part")
  94. o69 = Instance.new("ClickDetector")
  95. o70 = Instance.new("Script")
  96. o71 = Instance.new("Decal")
  97. o72 = Instance.new("Part")
  98. o1.Parent = mas
  99. o1.Material = Enum.Material.Wood
  100. o1.BrickColor = BrickColor.new("Cyan")
  101. o1.Position = Vector3.new(-3.15308928, 6.88134098, 56.1934052)
  102. o1.Anchored = true
  103. o1.Size = Vector3.new(20.039999, 14.0699978, 0.610000253)
  104. o1.CFrame = CFrame.new(-3.15308928, 6.88134098, 56.1934052, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  105. o1.BottomSurface = Enum.SurfaceType.Smooth
  106. o1.TopSurface = Enum.SurfaceType.Smooth
  107. o1.Color = Color3.new(0.0156863, 0.686275, 0.92549)
  108. o1.Position = Vector3.new(-3.15308928, 6.88134098, 56.1934052)
  109. o2.Parent = mas
  110. o2.Material = Enum.Material.Wood
  111. o2.BrickColor = BrickColor.new("CGA brown")
  112. o2.Position = Vector3.new(-2.81309295, 0.418967247, 46.0233307)
  113. o2.Anchored = true
  114. o2.Size = Vector3.new(19.0500011, 1, 19.7400036)
  115. o2.CFrame = CFrame.new(-2.81309295, 0.418967247, 46.0233307, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  116. o2.BottomSurface = Enum.SurfaceType.Smooth
  117. o2.TopSurface = Enum.SurfaceType.Smooth
  118. o2.Color = Color3.new(0.666667, 0.333333, 0)
  119. o2.Position = Vector3.new(-2.81309295, 0.418967247, 46.0233307)
  120. o3.Parent = mas
  121. o3.Material = Enum.Material.Wood
  122. o3.BrickColor = BrickColor.new("Cyan")
  123. o3.Position = Vector3.new(-12.6933155, 6.95396614, 46.165451)
  124. o3.Rotation = Vector3.new(0, 90, 0)
  125. o3.Anchored = true
  126. o3.Size = Vector3.new(19.619997, 14.0699978, 0.610000253)
  127. o3.CFrame = CFrame.new(-12.6933155, 6.95396614, 46.165451, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  128. o3.BottomSurface = Enum.SurfaceType.Smooth
  129. o3.TopSurface = Enum.SurfaceType.Smooth
  130. o3.Color = Color3.new(0.0156863, 0.686275, 0.92549)
  131. o3.Position = Vector3.new(-12.6933155, 6.95396614, 46.165451)
  132. o4.Parent = mas
  133. o4.Material = Enum.Material.Wood
  134. o4.BrickColor = BrickColor.new("Cyan")
  135. o4.Position = Vector3.new(6.46980476, 6.93079567, 46.165451)
  136. o4.Rotation = Vector3.new(0, 90, 0)
  137. o4.Anchored = true
  138. o4.Size = Vector3.new(19.619997, 14.0699978, 0.610000253)
  139. o4.CFrame = CFrame.new(6.46980476, 6.93079567, 46.165451, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  140. o4.BottomSurface = Enum.SurfaceType.Smooth
  141. o4.TopSurface = Enum.SurfaceType.Smooth
  142. o4.Color = Color3.new(0.0156863, 0.686275, 0.92549)
  143. o4.Position = Vector3.new(6.46980476, 6.93079567, 46.165451)
  144. o6.Parent = mas
  145. o6.Material = Enum.Material.Concrete
  146. o6.BrickColor = BrickColor.new("Institutional white")
  147. o6.Position = Vector3.new(2.03596711, 2.20613098, 35.9954376)
  148. o6.Rotation = Vector3.new(0, 90, 0)
  149. o6.Anchored = true
  150. o6.Size = Vector3.new(0.700000405, 3.05999851, 3.9799993)
  151. o6.CFrame = CFrame.new(2.03596711, 2.20613098, 35.9954376, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  152. o6.BottomSurface = Enum.SurfaceType.Smooth
  153. o6.Color = Color3.new(0.972549, 0.972549, 0.972549)
  154. o6.Position = Vector3.new(2.03596711, 2.20613098, 35.9954376)
  155. o7.Parent = mas
  156. o7.Material = Enum.Material.Concrete
  157. o7.BrickColor = BrickColor.new("Institutional white")
  158. o7.Position = Vector3.new(-8.18541145, 2.1911869, 35.9954376)
  159. o7.Rotation = Vector3.new(0, -90, 0)
  160. o7.Anchored = true
  161. o7.Size = Vector3.new(0.700000405, 3.05999851, 3.9799993)
  162. o7.CFrame = CFrame.new(-8.18541145, 2.1911869, 35.9954376, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  163. o7.BottomSurface = Enum.SurfaceType.Smooth
  164. o7.Color = Color3.new(0.972549, 0.972549, 0.972549)
  165. o7.Position = Vector3.new(-8.18541145, 2.1911869, 35.9954376)
  166. o8.Parent = mas
  167. o8.Material = Enum.Material.Concrete
  168. o8.BrickColor = BrickColor.new("Institutional white")
  169. o8.Position = Vector3.new(-8.16876411, 7.59485531, 35.9954376)
  170. o8.Rotation = Vector3.new(-180, -90, 0)
  171. o8.Anchored = true
  172. o8.Size = Vector3.new(0.700000405, 3.05999851, 3.9799993)
  173. o8.CFrame = CFrame.new(-8.16876411, 7.59485531, 35.9954376, 0, 0, -1, 0, -1, 0, -1, 0, 0)
  174. o8.BottomSurface = Enum.SurfaceType.Smooth
  175. o8.Color = Color3.new(0.972549, 0.972549, 0.972549)
  176. o8.Position = Vector3.new(-8.16876411, 7.59485531, 35.9954376)
  177. o9.Parent = mas
  178. o9.Material = Enum.Material.Concrete
  179. o9.BrickColor = BrickColor.new("Institutional white")
  180. o9.Position = Vector3.new(1.97784638, 7.58220005, 35.9954376)
  181. o9.Rotation = Vector3.new(180, 90, 0)
  182. o9.Anchored = true
  183. o9.Size = Vector3.new(0.700000405, 3.05999851, 3.9799993)
  184. o9.CFrame = CFrame.new(1.97784638, 7.58220005, 35.9954376, 0, 0, 1, 0, -1, 0, 1, 0, 0)
  185. o9.BottomSurface = Enum.SurfaceType.Smooth
  186. o9.Color = Color3.new(0.972549, 0.972549, 0.972549)
  187. o9.Position = Vector3.new(1.97784638, 7.58220005, 35.9954376)
  188. o10.Parent = mas
  189. o10.Material = Enum.Material.Wood
  190. o10.BrickColor = BrickColor.new("Cyan")
  191. o10.Position = Vector3.new(6.46980476, 21.0007896, 46.165451)
  192. o10.Rotation = Vector3.new(0, 90, 0)
  193. o10.Anchored = true
  194. o10.Size = Vector3.new(19.619997, 14.0699978, 0.610000253)
  195. o10.CFrame = CFrame.new(6.46980476, 21.0007896, 46.165451, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  196. o10.BottomSurface = Enum.SurfaceType.Smooth
  197. o10.TopSurface = Enum.SurfaceType.Smooth
  198. o10.Color = Color3.new(0.0156863, 0.686275, 0.92549)
  199. o10.Position = Vector3.new(6.46980476, 21.0007896, 46.165451)
  200. o11.Parent = mas
  201. o11.Material = Enum.Material.Wood
  202. o11.BrickColor = BrickColor.new("Cyan")
  203. o11.Position = Vector3.new(-3.15308928, 20.8681259, 56.1934052)
  204. o11.Anchored = true
  205. o11.Size = Vector3.new(20.039999, 14.0699978, 0.610000253)
  206. o11.CFrame = CFrame.new(-3.15308928, 20.8681259, 56.1934052, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  207. o11.BottomSurface = Enum.SurfaceType.Smooth
  208. o11.TopSurface = Enum.SurfaceType.Smooth
  209. o11.Color = Color3.new(0.0156863, 0.686275, 0.92549)
  210. o11.Position = Vector3.new(-3.15308928, 20.8681259, 56.1934052)
  211. o12.Parent = mas
  212. o12.Material = Enum.Material.Wood
  213. o12.BrickColor = BrickColor.new("Cyan")
  214. o12.Position = Vector3.new(-12.6933155, 21.0315361, 46.165451)
  215. o12.Rotation = Vector3.new(0, 90, 0)
  216. o12.Anchored = true
  217. o12.Size = Vector3.new(19.619997, 14.0699978, 0.610000253)
  218. o12.CFrame = CFrame.new(-12.6933155, 21.0315361, 46.165451, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  219. o12.BottomSurface = Enum.SurfaceType.Smooth
  220. o12.TopSurface = Enum.SurfaceType.Smooth
  221. o12.Color = Color3.new(0.0156863, 0.686275, 0.92549)
  222. o12.Position = Vector3.new(-12.6933155, 21.0315361, 46.165451)
  223. o13.Parent = mas
  224. o13.Material = Enum.Material.Wood
  225. o13.BrickColor = BrickColor.new("Cyan")
  226. o13.Position = Vector3.new(-3.15308928, 20.9867172, 35.9763336)
  227. o13.Anchored = true
  228. o13.Size = Vector3.new(20.039999, 14.0699978, 0.610000253)
  229. o13.CFrame = CFrame.new(-3.15308928, 20.9867172, 35.9763336, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  230. o13.BottomSurface = Enum.SurfaceType.Smooth
  231. o13.TopSurface = Enum.SurfaceType.Smooth
  232. o13.Color = Color3.new(0.0156863, 0.686275, 0.92549)
  233. o13.Position = Vector3.new(-3.15308928, 20.9867172, 35.9763336)
  234. o14.Parent = mas
  235. o14.Material = Enum.Material.Concrete
  236. o14.BrickColor = BrickColor.new("Institutional white")
  237. o14.Position = Vector3.new(1.72670197, 13.6418896, 46.0437469)
  238. o14.Anchored = true
  239. o14.Size = Vector3.new(8.95000458, 0.569999993, 19.6799889)
  240. o14.CFrame = CFrame.new(1.72670197, 13.6418896, 46.0437469, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  241. o14.BottomSurface = Enum.SurfaceType.Smooth
  242. o14.TopSurface = Enum.SurfaceType.Smooth
  243. o14.Color = Color3.new(0.972549, 0.972549, 0.972549)
  244. o14.Position = Vector3.new(1.72670197, 13.6418896, 46.0437469)
  245. o15.Parent = mas
  246. o15.Material = Enum.Material.Concrete
  247. o15.BrickColor = BrickColor.new("Institutional white")
  248. o15.Position = Vector3.new(-7.59631538, 13.7386875, 40.7838898)
  249. o15.Anchored = true
  250. o15.Size = Vector3.new(9.71000385, 0.569999993, 9.15998554)
  251. o15.CFrame = CFrame.new(-7.59631538, 13.7386875, 40.7838898, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  252. o15.BottomSurface = Enum.SurfaceType.Smooth
  253. o15.TopSurface = Enum.SurfaceType.Smooth
  254. o15.Color = Color3.new(0.972549, 0.972549, 0.972549)
  255. o15.Position = Vector3.new(-7.59631538, 13.7386875, 40.7838898)
  256. o16.Parent = mas
  257. o17.Parent = o16
  258. o17.Material = Enum.Material.Metal
  259. o17.BrickColor = BrickColor.new("Lily white")
  260. o17.Position = Vector3.new(-2.92170501, 0.988617897, 51.785141)
  261. o17.Rotation = Vector3.new(-180, -89.2900009, -180)
  262. o17.Anchored = true
  263. o17.Shape = Enum.PartType.Cylinder
  264. o17.Size = Vector3.new(3.99999881, 0.400000006, 0.999984443)
  265. o17.CFrame = CFrame.new(-2.92170501, 0.988617897, 51.785141, -0.0124000022, 0, -0.99992311, 0, 1, 0, 0.99992311, 0, -0.0124000032)
  266. o17.BottomSurface = Enum.SurfaceType.Smooth
  267. o17.TopSurface = Enum.SurfaceType.Smooth
  268. o17.Color = Color3.new(0.929412, 0.917647, 0.917647)
  269. o17.Position = Vector3.new(-2.92170501, 0.988617897, 51.785141)
  270. o18.Parent = o16
  271. o18.Material = Enum.Material.Metal
  272. o18.BrickColor = BrickColor.new("Lily white")
  273. o18.Position = Vector3.new(-2.92170501, -3.01139379, 51.785141)
  274. o18.Rotation = Vector3.new(-180, -89.2900009, -180)
  275. o18.Anchored = true
  276. o18.Shape = Enum.PartType.Cylinder
  277. o18.Size = Vector3.new(3.99999881, 0.400000006, 0.999984443)
  278. o18.CFrame = CFrame.new(-2.92170501, -3.01139379, 51.785141, -0.0124000022, 0, -0.99992311, 0, 1, 0, 0.99992311, 0, -0.0124000032)
  279. o18.BottomSurface = Enum.SurfaceType.Smooth
  280. o18.TopSurface = Enum.SurfaceType.Smooth
  281. o18.Color = Color3.new(0.929412, 0.917647, 0.917647)
  282. o18.Position = Vector3.new(-2.92170501, -3.01139379, 51.785141)
  283. o19.Parent = o16
  284. o19.Material = Enum.Material.Metal
  285. o19.BrickColor = BrickColor.new("Lily white")
  286. o19.Position = Vector3.new(-2.92170501, -2.01140904, 51.785141)
  287. o19.Rotation = Vector3.new(-180, -89.2900009, -180)
  288. o19.Anchored = true
  289. o19.Shape = Enum.PartType.Cylinder
  290. o19.Size = Vector3.new(3.99999881, 0.400000006, 0.999984443)
  291. o19.CFrame = CFrame.new(-2.92170501, -2.01140904, 51.785141, -0.0124000022, 0, -0.99992311, 0, 1, 0, 0.99992311, 0, -0.0124000032)
  292. o19.BottomSurface = Enum.SurfaceType.Smooth
  293. o19.TopSurface = Enum.SurfaceType.Smooth
  294. o19.Color = Color3.new(0.929412, 0.917647, 0.917647)
  295. o19.Position = Vector3.new(-2.92170501, -2.01140904, 51.785141)
  296. o20.Parent = o16
  297. o20.Material = Enum.Material.Metal
  298. o20.BrickColor = BrickColor.new("Lily white")
  299. o20.Position = Vector3.new(-2.92170501, 2.9886179, 51.785141)
  300. o20.Rotation = Vector3.new(-180, -89.2900009, -180)
  301. o20.Anchored = true
  302. o20.Shape = Enum.PartType.Cylinder
  303. o20.Size = Vector3.new(3.99999881, 0.400000006, 0.999984443)
  304. o20.CFrame = CFrame.new(-2.92170501, 2.9886179, 51.785141, -0.0124000022, 0, -0.99992311, 0, 1, 0, 0.99992311, 0, -0.0124000032)
  305. o20.BottomSurface = Enum.SurfaceType.Smooth
  306. o20.TopSurface = Enum.SurfaceType.Smooth
  307. o20.Color = Color3.new(0.929412, 0.917647, 0.917647)
  308. o20.Position = Vector3.new(-2.92170501, 2.9886179, 51.785141)
  309. o21.Parent = o16
  310. o21.Material = Enum.Material.Metal
  311. o21.BrickColor = BrickColor.new("Lily white")
  312. o21.Position = Vector3.new(-2.92170501, 3.9886179, 51.785141)
  313. o21.Rotation = Vector3.new(-180, -89.2900009, -180)
  314. o21.Anchored = true
  315. o21.Shape = Enum.PartType.Cylinder
  316. o21.Size = Vector3.new(3.99999881, 0.400000006, 0.999984443)
  317. o21.CFrame = CFrame.new(-2.92170501, 3.9886179, 51.785141, -0.0124000022, 0, -0.99992311, 0, 1, 0, 0.99992311, 0, -0.0124000032)
  318. o21.BottomSurface = Enum.SurfaceType.Smooth
  319. o21.TopSurface = Enum.SurfaceType.Smooth
  320. o21.Color = Color3.new(0.929412, 0.917647, 0.917647)
  321. o21.Position = Vector3.new(-2.92170501, 3.9886179, 51.785141)
  322. o22.Parent = o16
  323. o22.Material = Enum.Material.Metal
  324. o22.BrickColor = BrickColor.new("Lily white")
  325. o22.Position = Vector3.new(-2.92170501, 7.98863411, 51.785141)
  326. o22.Rotation = Vector3.new(-180, -89.2900009, -180)
  327. o22.Anchored = true
  328. o22.Shape = Enum.PartType.Cylinder
  329. o22.Size = Vector3.new(3.99999881, 0.400000006, 0.999984443)
  330. o22.CFrame = CFrame.new(-2.92170501, 7.98863411, 51.785141, -0.0124000022, 0, -0.99992311, 0, 1, 0, 0.99992311, 0, -0.0124000032)
  331. o22.BottomSurface = Enum.SurfaceType.Smooth
  332. o22.TopSurface = Enum.SurfaceType.Smooth
  333. o22.Color = Color3.new(0.929412, 0.917647, 0.917647)
  334. o22.Position = Vector3.new(-2.92170501, 7.98863411, 51.785141)
  335. o23.Parent = o16
  336. o23.Material = Enum.Material.Metal
  337. o23.BrickColor = BrickColor.new("Lily white")
  338. o23.Position = Vector3.new(-2.92170501, 10.9886875, 51.785141)
  339. o23.Rotation = Vector3.new(-180, -89.2900009, -180)
  340. o23.Anchored = true
  341. o23.Shape = Enum.PartType.Cylinder
  342. o23.Size = Vector3.new(3.99999881, 0.400000006, 0.999984443)
  343. o23.CFrame = CFrame.new(-2.92170501, 10.9886875, 51.785141, -0.0124000022, 0, -0.99992311, 0, 1, 0, 0.99992311, 0, -0.0124000032)
  344. o23.BottomSurface = Enum.SurfaceType.Smooth
  345. o23.TopSurface = Enum.SurfaceType.Smooth
  346. o23.Color = Color3.new(0.929412, 0.917647, 0.917647)
  347. o23.Position = Vector3.new(-2.92170501, 10.9886875, 51.785141)
  348. o24.Parent = o16
  349. o24.Material = Enum.Material.Metal
  350. o24.BrickColor = BrickColor.new("Lily white")
  351. o24.Position = Vector3.new(-2.92170501, 12.9887028, 51.785141)
  352. o24.Rotation = Vector3.new(-180, -89.2900009, -180)
  353. o24.Anchored = true
  354. o24.Shape = Enum.PartType.Cylinder
  355. o24.Size = Vector3.new(3.99999881, 0.400000006, 0.999984443)
  356. o24.CFrame = CFrame.new(-2.92170501, 12.9887028, 51.785141, -0.0124000022, 0, -0.99992311, 0, 1, 0, 0.99992311, 0, -0.0124000032)
  357. o24.BottomSurface = Enum.SurfaceType.Smooth
  358. o24.TopSurface = Enum.SurfaceType.Smooth
  359. o24.Color = Color3.new(0.929412, 0.917647, 0.917647)
  360. o24.Position = Vector3.new(-2.92170501, 12.9887028, 51.785141)
  361. o25.Parent = o16
  362. o25.Material = Enum.Material.Metal
  363. o25.BrickColor = BrickColor.new("Lily white")
  364. o25.Position = Vector3.new(-2.92170501, 1.9886179, 51.785141)
  365. o25.Rotation = Vector3.new(-180, -89.2900009, -180)
  366. o25.Anchored = true
  367. o25.Shape = Enum.PartType.Cylinder
  368. o25.Size = Vector3.new(3.99999881, 0.400000006, 0.999984443)
  369. o25.CFrame = CFrame.new(-2.92170501, 1.9886179, 51.785141, -0.0124000022, 0, -0.99992311, 0, 1, 0, 0.99992311, 0, -0.0124000032)
  370. o25.BottomSurface = Enum.SurfaceType.Smooth
  371. o25.TopSurface = Enum.SurfaceType.Smooth
  372. o25.Color = Color3.new(0.929412, 0.917647, 0.917647)
  373. o25.Position = Vector3.new(-2.92170501, 1.9886179, 51.785141)
  374. o26.Parent = o16
  375. o26.Material = Enum.Material.Metal
  376. o26.BrickColor = BrickColor.new("Lily white")
  377. o26.Position = Vector3.new(-2.92170501, 9.98864174, 51.785141)
  378. o26.Rotation = Vector3.new(-180, -89.2900009, -180)
  379. o26.Anchored = true
  380. o26.Shape = Enum.PartType.Cylinder
  381. o26.Size = Vector3.new(3.99999881, 0.400000006, 0.999984443)
  382. o26.CFrame = CFrame.new(-2.92170501, 9.98864174, 51.785141, -0.0124000022, 0, -0.99992311, 0, 1, 0, 0.99992311, 0, -0.0124000032)
  383. o26.BottomSurface = Enum.SurfaceType.Smooth
  384. o26.TopSurface = Enum.SurfaceType.Smooth
  385. o26.Color = Color3.new(0.929412, 0.917647, 0.917647)
  386. o26.Position = Vector3.new(-2.92170501, 9.98864174, 51.785141)
  387. o27.Parent = o16
  388. o27.Material = Enum.Material.Metal
  389. o27.BrickColor = BrickColor.new("Lily white")
  390. o27.Position = Vector3.new(-2.92170501, 4.9886179, 51.785141)
  391. o27.Rotation = Vector3.new(-180, -89.2900009, -180)
  392. o27.Anchored = true
  393. o27.Shape = Enum.PartType.Cylinder
  394. o27.Size = Vector3.new(3.99999881, 0.400000006, 0.999984443)
  395. o27.CFrame = CFrame.new(-2.92170501, 4.9886179, 51.785141, -0.0124000022, 0, -0.99992311, 0, 1, 0, 0.99992311, 0, -0.0124000032)
  396. o27.BottomSurface = Enum.SurfaceType.Smooth
  397. o27.TopSurface = Enum.SurfaceType.Smooth
  398. o27.Color = Color3.new(0.929412, 0.917647, 0.917647)
  399. o27.Position = Vector3.new(-2.92170501, 4.9886179, 51.785141)
  400. o28.Parent = o16
  401. o28.Material = Enum.Material.Metal
  402. o28.BrickColor = BrickColor.new("Lily white")
  403. o28.Position = Vector3.new(-2.92170501, 5.98863316, 51.785141)
  404. o28.Rotation = Vector3.new(-180, -89.2900009, -180)
  405. o28.Anchored = true
  406. o28.Shape = Enum.PartType.Cylinder
  407. o28.Size = Vector3.new(3.99999881, 0.400000006, 0.999984443)
  408. o28.CFrame = CFrame.new(-2.92170501, 5.98863316, 51.785141, -0.0124000022, 0, -0.99992311, 0, 1, 0, 0.99992311, 0, -0.0124000032)
  409. o28.BottomSurface = Enum.SurfaceType.Smooth
  410. o28.TopSurface = Enum.SurfaceType.Smooth
  411. o28.Color = Color3.new(0.929412, 0.917647, 0.917647)
  412. o28.Position = Vector3.new(-2.92170501, 5.98863316, 51.785141)
  413. o29.Parent = o16
  414. o29.Material = Enum.Material.Metal
  415. o29.BrickColor = BrickColor.new("Lily white")
  416. o29.Position = Vector3.new(-2.92170501, 6.98863316, 51.785141)
  417. o29.Rotation = Vector3.new(-180, -89.2900009, -180)
  418. o29.Anchored = true
  419. o29.Shape = Enum.PartType.Cylinder
  420. o29.Size = Vector3.new(3.99999881, 0.400000006, 0.999984443)
  421. o29.CFrame = CFrame.new(-2.92170501, 6.98863316, 51.785141, -0.0124000022, 0, -0.99992311, 0, 1, 0, 0.99992311, 0, -0.0124000032)
  422. o29.BottomSurface = Enum.SurfaceType.Smooth
  423. o29.TopSurface = Enum.SurfaceType.Smooth
  424. o29.Color = Color3.new(0.929412, 0.917647, 0.917647)
  425. o29.Position = Vector3.new(-2.92170501, 6.98863316, 51.785141)
  426. o30.Parent = o16
  427. o30.Material = Enum.Material.Metal
  428. o30.BrickColor = BrickColor.new("Lily white")
  429. o30.Position = Vector3.new(-2.92170501, 8.98863411, 51.785141)
  430. o30.Rotation = Vector3.new(-180, -89.2900009, -180)
  431. o30.Anchored = true
  432. o30.Shape = Enum.PartType.Cylinder
  433. o30.Size = Vector3.new(3.99999881, 0.400000006, 0.999984443)
  434. o30.CFrame = CFrame.new(-2.92170501, 8.98863411, 51.785141, -0.0124000022, 0, -0.99992311, 0, 1, 0, 0.99992311, 0, -0.0124000032)
  435. o30.BottomSurface = Enum.SurfaceType.Smooth
  436. o30.TopSurface = Enum.SurfaceType.Smooth
  437. o30.Color = Color3.new(0.929412, 0.917647, 0.917647)
  438. o30.Position = Vector3.new(-2.92170501, 8.98863411, 51.785141)
  439. o31.Parent = o16
  440. o31.Material = Enum.Material.Metal
  441. o31.BrickColor = BrickColor.new("Lily white")
  442. o31.Position = Vector3.new(-2.92170501, 11.9886866, 51.785141)
  443. o31.Rotation = Vector3.new(-180, -89.2900009, -180)
  444. o31.Anchored = true
  445. o31.Shape = Enum.PartType.Cylinder
  446. o31.Size = Vector3.new(3.99999881, 0.400000006, 0.999984443)
  447. o31.CFrame = CFrame.new(-2.92170501, 11.9886866, 51.785141, -0.0124000022, 0, -0.99992311, 0, 1, 0, 0.99992311, 0, -0.0124000032)
  448. o31.BottomSurface = Enum.SurfaceType.Smooth
  449. o31.TopSurface = Enum.SurfaceType.Smooth
  450. o31.Color = Color3.new(0.929412, 0.917647, 0.917647)
  451. o31.Position = Vector3.new(-2.92170501, 11.9886866, 51.785141)
  452. o32.Parent = o16
  453. o32.Material = Enum.Material.Metal
  454. o32.BrickColor = BrickColor.new("Lily white")
  455. o32.Position = Vector3.new(-2.92170501, -4.0114851, 51.785141)
  456. o32.Rotation = Vector3.new(-180, -89.2900009, -180)
  457. o32.Anchored = true
  458. o32.Shape = Enum.PartType.Cylinder
  459. o32.Size = Vector3.new(3.99999881, 0.400000006, 0.999984443)
  460. o32.CFrame = CFrame.new(-2.92170501, -4.0114851, 51.785141, -0.0124000022, 0, -0.99992311, 0, 1, 0, 0.99992311, 0, -0.0124000032)
  461. o32.BottomSurface = Enum.SurfaceType.Smooth
  462. o32.TopSurface = Enum.SurfaceType.Smooth
  463. o32.Color = Color3.new(0.929412, 0.917647, 0.917647)
  464. o32.Position = Vector3.new(-2.92170501, -4.0114851, 51.785141)
  465. o33.Parent = o16
  466. o33.Material = Enum.Material.Metal
  467. o33.BrickColor = BrickColor.new("Lily white")
  468. o33.Position = Vector3.new(-2.92170501, -1.01141667, 51.785141)
  469. o33.Rotation = Vector3.new(-180, -89.2900009, -180)
  470. o33.Anchored = true
  471. o33.Shape = Enum.PartType.Cylinder
  472. o33.Size = Vector3.new(3.99999881, 0.400000006, 0.999984443)
  473. o33.CFrame = CFrame.new(-2.92170501, -1.01141667, 51.785141, -0.0124000022, 0, -0.99992311, 0, 1, 0, 0.99992311, 0, -0.0124000032)
  474. o33.BottomSurface = Enum.SurfaceType.Smooth
  475. o33.TopSurface = Enum.SurfaceType.Smooth
  476. o33.Color = Color3.new(0.929412, 0.917647, 0.917647)
  477. o33.Position = Vector3.new(-2.92170501, -1.01141667, 51.785141)
  478. o34.Parent = o16
  479. o34.Material = Enum.Material.Metal
  480. o34.BrickColor = BrickColor.new("Lily white")
  481. o34.Position = Vector3.new(-2.92170501, -0.0113744736, 51.785141)
  482. o34.Rotation = Vector3.new(-180, -89.2900009, -180)
  483. o34.Anchored = true
  484. o34.Shape = Enum.PartType.Cylinder
  485. o34.Size = Vector3.new(3.99999881, 0.400000006, 0.999984443)
  486. o34.CFrame = CFrame.new(-2.92170501, -0.0113744736, 51.785141, -0.0124000022, 0, -0.99992311, 0, 1, 0, 0.99992311, 0, -0.0124000032)
  487. o34.BottomSurface = Enum.SurfaceType.Smooth
  488. o34.TopSurface = Enum.SurfaceType.Smooth
  489. o34.Color = Color3.new(0.929412, 0.917647, 0.917647)
  490. o34.Position = Vector3.new(-2.92170501, -0.0113744736, 51.785141)
  491. o35.Parent = o16
  492. o35.Material = Enum.Material.Metal
  493. o35.BrickColor = BrickColor.new("Really red")
  494. o35.Position = Vector3.new(-2.89697051, 4.58860111, 49.785347)
  495. o35.Rotation = Vector3.new(-180, -89.2900009, -90)
  496. o35.Anchored = true
  497. o35.Shape = Enum.PartType.Cylinder
  498. o35.Size = Vector3.new(18.8000011, 0.399965286, 0.999915361)
  499. o35.CFrame = CFrame.new(-2.89697051, 4.58860111, 49.785347, 0, 0.0124000022, -0.99992311, 1, 0, 0, 0, -0.99992311, -0.0124000032)
  500. o35.BottomSurface = Enum.SurfaceType.Smooth
  501. o35.TopSurface = Enum.SurfaceType.Smooth
  502. o35.Color = Color3.new(1, 0, 0)
  503. o35.Position = Vector3.new(-2.89697051, 4.58860111, 49.785347)
  504. o36.Parent = o16
  505. o36.Material = Enum.Material.Metal
  506. o36.BrickColor = BrickColor.new("Really red")
  507. o36.Position = Vector3.new(-2.94653106, 4.58860111, 53.78508)
  508. o36.Rotation = Vector3.new(-180, -89.2900009, -90)
  509. o36.Anchored = true
  510. o36.Shape = Enum.PartType.Cylinder
  511. o36.Size = Vector3.new(18.8000011, 0.399965286, 0.999915361)
  512. o36.CFrame = CFrame.new(-2.94653106, 4.58860111, 53.78508, 0, 0.0124000022, -0.99992311, 1, 0, 0, 0, -0.99992311, -0.0124000032)
  513. o36.BottomSurface = Enum.SurfaceType.Smooth
  514. o36.TopSurface = Enum.SurfaceType.Smooth
  515. o36.Color = Color3.new(1, 0, 0)
  516. o36.Position = Vector3.new(-2.94653106, 4.58860111, 53.78508)
  517. o37.Parent = mas
  518. o37.BrickColor = BrickColor.new("Institutional white")
  519. o37.Position = Vector3.new(-0.541031837, 12.970232, 45.879097)
  520. o37.Anchored = true
  521. o37.Size = Vector3.new(1.88000059, 1, 1.71000016)
  522. o37.CFrame = CFrame.new(-0.541031837, 12.970232, 45.879097, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  523. o37.BottomSurface = Enum.SurfaceType.Smooth
  524. o37.TopSurface = Enum.SurfaceType.Smooth
  525. o37.Color = Color3.new(0.972549, 0.972549, 0.972549)
  526. o37.Position = Vector3.new(-0.541031837, 12.970232, 45.879097)
  527. o38.Parent = o37
  528. o38.Range = 10
  529. o39.Name = "Pistol"
  530. o39.Parent = mas
  531. o39.GripForward = Vector3.new(-0, 1, -0)
  532. o39.GripPos = Vector3.new(0, -0.400000006, -0.400000006)
  533. o39.GripUp = Vector3.new(0, 0, 1)
  534. o40.Name = "Configurations"
  535. o40.Parent = o39
  536. o41.Name = "ClipSize"
  537. o41.Parent = o40
  538. o41.Value = 8
  539. o42.Name = "AttackCooldown"
  540. o42.Parent = o40
  541. o42.Value = 0.15
  542. o43.Name = "Range"
  543. o43.Parent = o40
  544. o43.Value = 300
  545. o44.Name = "Damage"
  546. o44.Parent = o40
  547. o44.Value = 20
  548. o45.Name = "ReloadTime"
  549. o45.Parent = o40
  550. o45.Value = 1
  551. o46.Parent = o39
  552. table.insert(cors,coroutine.create(function()
  553. wait()
  554. runDummyScript(function()
  555. -- Variables for services
  556. local render = game:GetService("RunService").RenderStepped
  557. local contextActionService = game:GetService("ContextActionService")
  558. local userInputService = game:GetService("UserInputService")
  559.  
  560. local player = game.Players.LocalPlayer
  561. local mouse = player:GetMouse()
  562. local Tool = script.Parent
  563.  
  564. -- Variables for Module Scripts
  565. local screenSpace = require(Tool:WaitForChild("ScreenSpace"))
  566.  
  567. local connection
  568. -- Variables for character joints
  569.  
  570. local neck, shoulder, oldNeckC0, oldShoulderC0
  571.  
  572. local mobileShouldTrack = true
  573.  
  574. -- Thourough check to see if a character is sitting
  575. local function amISitting(character)
  576. local t = character.Torso
  577. for _, part in pairs(t:GetConnectedParts(true)) do
  578. if part:IsA("Seat") or part:IsA("VehicleSeat") then
  579. return true
  580. end
  581. end
  582. end
  583.  
  584. -- Function to call on renderstepped. Orients the character so it is facing towards
  585. -- the player mouse's position in world space. If character is sitting then the torso
  586. -- should not track
  587. local function frame(mousePosition)
  588. -- Special mobile consideration. We don't want to track if the user was touching a ui
  589. -- element such as the movement controls. Just return out of function if so to make sure
  590. -- character doesn't track
  591. if not mobileShouldTrack then return end
  592.  
  593. -- Make sure character isn't swiming. If the character is swimming the following code will
  594. -- not work well; the character will not swim correctly. Besides, who shoots underwater?
  595. if player.Character.Humanoid:GetState() ~= Enum.HumanoidStateType.Swimming then
  596. local torso = player.Character.Torso
  597. local head = player.Character.Head
  598.  
  599. local toMouse = (mousePosition - head.Position).unit
  600. local angle = math.acos(toMouse:Dot(Vector3.new(0,1,0)))
  601.  
  602. local neckAngle = angle
  603.  
  604. -- Limit how much the head can tilt down. Too far and the head looks unnatural
  605. if math.deg(neckAngle) > 110 then
  606. neckAngle = math.rad(110)
  607. end
  608. neck.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.pi - neckAngle,math.pi,0)
  609.  
  610. -- Calculate horizontal rotation
  611. local arm = player.Character:FindFirstChild("Right Arm")
  612. local fromArmPos = torso.Position + torso.CFrame:vectorToWorldSpace(Vector3.new(
  613. torso.Size.X/2 + arm.Size.X/2, torso.Size.Y/2 - arm.Size.Z/2, 0))
  614. local toMouseArm = ((mousePosition - fromArmPos) * Vector3.new(1,0,1)).unit
  615. local look = (torso.CFrame.lookVector * Vector3.new(1,0,1)).unit
  616. local lateralAngle = math.acos(toMouseArm:Dot(look))
  617.  
  618. -- Check for rogue math
  619. if tostring(lateralAngle) == "-1.#IND" then
  620. lateralAngle = 0
  621. end
  622.  
  623. -- Handle case where character is sitting down
  624. if player.Character.Humanoid:GetState() == Enum.HumanoidStateType.Seated then
  625.  
  626. local cross = torso.CFrame.lookVector:Cross(toMouseArm)
  627. if lateralAngle > math.pi/2 then
  628. lateralAngle = math.pi/2
  629. end
  630. if cross.Y < 0 then
  631. lateralAngle = -lateralAngle
  632. end
  633. end
  634.  
  635. -- Turn shoulder to point to mouse
  636. shoulder.C0 = CFrame.new(1,0.5,0) * CFrame.Angles(math.pi/2 - angle,math.pi/2 + lateralAngle,0)
  637.  
  638. -- If not sitting then aim torso laterally towards mouse
  639. if not amISitting(player.Character) then
  640. torso.CFrame = CFrame.new(torso.Position, torso.Position + (Vector3.new(
  641. mousePosition.X, torso.Position.Y, mousePosition.Z)-torso.Position).unit)
  642. else
  643. --print("sitting")
  644. end
  645. end
  646. end
  647.  
  648. -- Function to bind to render stepped if player is on PC
  649. local function pcFrame()
  650. frame(mouse.Hit.p)
  651. end
  652.  
  653. -- Function to bind to touch moved if player is on mobile
  654. local function mobileFrame(touch, processed)
  655. -- Check to see if the touch was on a UI element. If so, we don't want to update anything
  656. if not processed then
  657. -- Calculate touch position in world space. Uses Stravant's ScreenSpace Module script
  658. -- to create a ray from the camera.
  659. local test = screenSpace.ScreenToWorld(touch.Position.X, touch.Position.Y, 1)
  660. local nearPos = game.Workspace.CurrentCamera.CoordinateFrame:vectorToWorldSpace(screenSpace.ScreenToWorld(touch.Position.X, touch.Position.Y, 1))
  661. nearPos = game.Workspace.CurrentCamera.CoordinateFrame.p - nearPos
  662. local farPos = screenSpace.ScreenToWorld(touch.Position.X, touch.Position.Y,50)
  663. farPos = game.Workspace.CurrentCamera.CoordinateFrame:vectorToWorldSpace(farPos) * -1
  664. if farPos.magnitude > 900 then
  665. farPos = farPos.unit * 900
  666. end
  667. local ray = Ray.new(nearPos, farPos)
  668. local part, pos = game.Workspace:FindPartOnRay(ray, player.Character)
  669.  
  670. -- if a position was found on the ray then update the character's rotation
  671. if pos then
  672. frame(pos)
  673. end
  674. end
  675. end
  676.  
  677. local oldIcon = nil
  678. -- Function to bind to equip event
  679. local function equip()
  680. local torso = player.Character.Torso
  681.  
  682. -- Setup joint variables
  683. neck = torso.Neck
  684. oldNeckC0 = neck.C0
  685. shoulder = torso:FindFirstChild("Right Shoulder")
  686. oldShoulderC0 = shoulder.C0
  687.  
  688. -- Remember old mouse icon and update current
  689. oldIcon = mouse.Icon
  690. mouse.Icon = "http://www.roblox.com/asset/?id=79658449"
  691.  
  692. -- Bind TouchMoved event if on mobile. Otherwise connect to renderstepped
  693. if userInputService.TouchEnabled then
  694. connection = userInputService.TouchMoved:connect(mobileFrame)
  695. else
  696. connection = render:connect(pcFrame)
  697. end
  698.  
  699. -- Bind TouchStarted and TouchEnded. Used to determine if character should rotate
  700. -- during touch input
  701. userInputService.TouchStarted:connect(function(touch, processed)
  702. mobileShouldTrack = not processed
  703. end)
  704. userInputService.TouchEnded:connect(function(touch, processed)
  705. mobileShouldTrack = false
  706. end)
  707.  
  708. -- Fire server's equip event
  709. game.ReplicatedStorage.ROBLOX_PistolEquipEvent:FireServer()
  710.  
  711. -- Bind event for when mouse is clicked to fire server's fire event
  712. mouse.Button1Down:connect(function()
  713. game.ReplicatedStorage.ROBLOX_PistolFireEvent:FireServer(mouse.Hit.p)
  714. end)
  715.  
  716. -- Bind reload event to mobile button and r key
  717. contextActionService:BindActionToInputTypes("Reload", function()
  718. game.ReplicatedStorage.ROBLOX_PistolReloadEvent:FireServer()
  719. end, true, "r")
  720.  
  721. -- If game uses filtering enabled then need to update server while tool is
  722. -- held by character.
  723. if workspace.FilteringEnabled then
  724. while connection do
  725. wait()
  726. game.ReplicatedStorage.ROBLOX_PistolUpdateEvent:FireServer(neck.C0, shoulder.C0)
  727. end
  728. end
  729. end
  730.  
  731. -- Function to bind to Unequip event
  732. local function unequip()
  733. if connection then connection:disconnect() end
  734. contextActionService:UnbindAction("Reload")
  735. game.ReplicatedStorage.ROBLOX_PistolUnequipEvent:FireServer()
  736. mouse.Icon = oldIcon
  737. neck.C0 = oldNeckC0
  738. shoulder.C0 = oldShoulderC0
  739. end
  740.  
  741. -- Bind tool events
  742. Tool.Equipped:connect(equip)
  743. Tool.Unequipped:connect(unequip)
  744. end,o46)
  745. end))
  746. o47.Parent = o39
  747. table.insert(cors,coroutine.create(function()
  748. wait()
  749. runDummyScript(function()
  750. -- Local variables
  751. local tool = script.Parent
  752. local currentAmmo = tool.Configurations.ClipSize.Value
  753. local canFire = true
  754. local reloading = false
  755. local fireSound = tool.FireSound
  756.  
  757. -- Configurable variables
  758. local attackCooldown = tool.Configurations.AttackCooldown.Value
  759. local range = tool.Configurations.Range.Value
  760. local damage = tool.Configurations.Damage.Value
  761. local reloadTime = tool.Configurations.ReloadTime.Value
  762. local clipSize = tool.Configurations.ClipSize.Value
  763.  
  764. -- Setup Remote Events
  765. local function createEvent(eventName)
  766. local event = game.ReplicatedStorage:FindFirstChild(eventName)
  767. if not event then
  768. event = Instance.new("RemoteEvent", game.ReplicatedStorage)
  769. event.Name = eventName
  770. end
  771. return event
  772. end
  773. local updateEvent = createEvent("ROBLOX_PistolUpdateEvent")
  774. local equipEvent = createEvent("ROBLOX_PistolEquipEvent")
  775. local unequipEvent = createEvent("ROBLOX_PistolUnequipEvent")
  776. local fireEvent = createEvent("ROBLOX_PistolFireEvent")
  777. local reloadEvent = createEvent("ROBLOX_PistolReloadEvent")
  778.  
  779. -- Add tracer decal to server storage if it isn't already there
  780. if not game.ServerStorage:FindFirstChild("ROBLOX_PistolTracerDecal") then
  781. tool.ROBLOX_PistolTracerDecal:Clone().Parent = game.ServerStorage
  782. end
  783.  
  784. -- Bind function to update event. Used to update player's orientation if FilteringEnabled
  785. -- is true (otherwise the rotation would not replicate from the rotating player)
  786. updateEvent.OnServerEvent:connect(function(player, neckC0, rshoulderC0)
  787. local character = player.Character
  788. character.Torso.Neck.C0 = neckC0
  789. character.Torso:FindFirstChild("Right Shoulder").C0 = rshoulderC0
  790. end)
  791.  
  792. -- Bind functions to when player equips/unequips the tool. Right now just need to turn on and
  793. -- off AutoRotate
  794. equipEvent.OnServerEvent:connect(function(player)
  795. player.Character.Humanoid.AutoRotate = false
  796. end)
  797. unequipEvent.OnServerEvent:connect(function(player)
  798. player.Character.Humanoid.AutoRotate = true
  799. end)
  800.  
  801. -- Creates "bullet". No projectile motion is actually used. Pistol raytraces to target and creates
  802. -- a tracer trail to the target. Fading trail gives illusion of motion.
  803. local function createBullet(target)
  804. -- Get actual handle position. Want to offset from the center of the handle as the bullet comes
  805. -- from the barrel of the gun
  806. local handlePos = tool.Handle.CFrame + tool.Handle.CFrame:vectorToWorldSpace(Vector3.new(0,0,.3))
  807. local toTarget = handlePos:vectorToWorldSpace(Vector3.new(0,1,0)) * 200
  808. local torsoLook = (tool.Parent:FindFirstChild("Torso").CFrame.lookVector * Vector3.new(1,0,1)).unit
  809. local toTargetAngle = (toTarget * Vector3.new(1,0,1)).unit
  810. local angle = math.acos(torsoLook:Dot(toTargetAngle))
  811.  
  812. -- Checks angle from where the character is facing to the orientation of the pistol. If the angle
  813. -- is less than 90 degress then we shoot to where the mouse is pointing (helps accuracy). Otherwise
  814. -- the gun is assumed at the edge of its rotation and just shoots straight.
  815. if math.deg(angle) < 90 then
  816. toTarget = target - tool.Handle.Position
  817. if toTarget.magnitude > range then
  818. toTarget = toTarget.unit * range
  819. end
  820. toTarget = toTarget * 1.1
  821. end
  822.  
  823. -- Shoot ray and check if humanoid was hit. If so, it should take damage
  824. local ray = Ray.new(handlePos.p, toTarget)
  825. local part, position = game.Workspace:FindPartOnRay(ray, tool.Parent)
  826. if part and part.Parent and part.Parent:FindFirstChild("Humanoid") then
  827. part.Parent:FindFirstChild("Humanoid"):TakeDamage(damage)
  828. end
  829.  
  830. if position then
  831. toTarget = position - handlePos.p
  832. end
  833.  
  834. -- Create tracer trail. Trail is made of thin parts 2 studs long. Fades each segment
  835. -- starting with closest tracer to the tool.
  836. local bulletTrail = Instance.new("Model", game.Workspace)
  837. local trailTable = {}
  838. -- Fetch decal from server storage
  839. local decal = game.ServerStorage.ROBLOX_PistolTracerDecal
  840. for i = 0, toTarget.magnitude/2, 1 do
  841. local trailSegment = Instance.new("Part", bulletTrail)
  842. trailSegment.CanCollide = false
  843. trailSegment.Anchored = true
  844. trailSegment.FormFactor = Enum.FormFactor.Custom
  845. trailSegment.Size = Vector3.new(.1,.1,2)
  846. trailSegment.BrickColor = BrickColor.White()
  847. trailSegment.CFrame = CFrame.new(handlePos.p + (toTarget.unit * 2 * (i + .5)), handlePos.p)
  848. trailSegment.Transparency = 1
  849.  
  850. -- Add point light to tracer for a little illumination
  851. local light = Instance.new("PointLight", trailSegment)
  852. light.Range = 3
  853.  
  854. -- Add decal to faces of the part
  855. local function addDecal(face)
  856. local decalClone = decal:Clone()
  857. decalClone.Parent = trailSegment
  858. decalClone.Face = face
  859. end
  860.  
  861. addDecal(Enum.NormalId.Top)
  862. addDecal(Enum.NormalId.Bottom)
  863. addDecal(Enum.NormalId.Left)
  864. addDecal(Enum.NormalId.Right)
  865.  
  866. -- Add segment to all of the tracers
  867. table.insert(trailTable, trailSegment)
  868. end
  869.  
  870. -- Coroutine thread to fade each trail segment. Put in coroutine so it does not
  871. -- block the rest of the pistol's script
  872. local fadeThread = coroutine.create(function()
  873. local count = 1
  874. local ended = false
  875. -- Keep looping until end condition is met
  876. while not ended do
  877. -- Assume end condition is met. Easier to switch it off later if we need to
  878. -- keep looping
  879. ended = true
  880. -- Loop through every part in the trail
  881. for index, part in pairs(trailTable) do
  882. if index <= count then
  883. local shouldDestroy = false
  884. for _, face in pairs(part:GetChildren()) do
  885.  
  886. if face:IsA("Decal") then
  887. -- Increase decal transparencies and use this to determine if
  888. -- segment has completely faded
  889. face.Transparency = face.Transparency + .05
  890. if face.Transparency < 1 then
  891. ended = false
  892. else
  893. shouldDestroy = true
  894. end
  895. else
  896. -- Dim the point light
  897. face.Brightness = face.Brightness - .1
  898. end
  899. end
  900. -- If segment is completely faded then clean it up
  901. if shouldDestroy then
  902. table.remove(trailTable, index)
  903. part:Destroy()
  904. end
  905. end
  906. end
  907. count = count + 1
  908. wait()
  909. end
  910. bulletTrail:Destroy()
  911. end)
  912. coroutine.resume(fadeThread)
  913. end
  914.  
  915. -- Function to bind to reload event
  916. local function reload()
  917. if not reloading then
  918. tool.ReloadSound:Play()
  919. reloading = true
  920. canFire = false
  921. wait(reloadTime)
  922. currentAmmo = clipSize
  923. canFire = true
  924. reloading = false
  925. end
  926. end
  927.  
  928. reloadEvent.OnServerEvent:connect(reload)
  929.  
  930. -- Bind function to fire event
  931. fireEvent.OnServerEvent:connect(function(player, target)
  932. if tool.Parent == player.Character then
  933. -- If tool has enough shots then fires. Otherwise reloads.
  934. if currentAmmo <= 0 then
  935. return reload()
  936. end
  937. if canFire then
  938. canFire = false
  939. currentAmmo = currentAmmo - 1
  940. fireSound:Play()
  941. createBullet(target)
  942. delay(attackCooldown, function()
  943. canFire = true
  944. end)
  945. end
  946. end
  947. end)
  948.  
  949.  
  950. end,o47)
  951. end))
  952. o48.Name = "ReloadSound"
  953. o48.Parent = o39
  954. o48.Pitch = 0.69999998807907
  955. o48.SoundId = "http://www.roblox.com/asset/?id=31762599"
  956. o48.Volume = 1
  957. o49.Name = "FireSound"
  958. o49.Parent = o39
  959. o49.Pitch = 0.69999998807907
  960. o49.SoundId = "http://www.roblox.com/asset/?id=12221976"
  961. o50.Name = "ROBLOX_PistolTracerDecal"
  962. o50.Parent = o39
  963. o50.Transparency = 0.5
  964. o50.Texture = "http://www.roblox.com/asset/?id=186982304"
  965. o50.Face = Enum.NormalId.Top
  966. o52.Parent = mas
  967. o52.BrickColor = BrickColor.new("Institutional white")
  968. o52.Position = Vector3.new(-3.04242778, 27.9451523, 45.879097)
  969. o52.Anchored = true
  970. o52.Size = Vector3.new(1.88000059, 1, 1.71000016)
  971. o52.CFrame = CFrame.new(-3.04242778, 27.9451523, 45.879097, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  972. o52.BottomSurface = Enum.SurfaceType.Smooth
  973. o52.TopSurface = Enum.SurfaceType.Smooth
  974. o52.Color = Color3.new(0.972549, 0.972549, 0.972549)
  975. o52.Position = Vector3.new(-3.04242778, 27.9451523, 45.879097)
  976. o53.Parent = o52
  977. o53.Range = 10
  978. o54.Name = "ButtonDoor"
  979. o54.Parent = mas
  980. o55.Name = "Door"
  981. o55.Parent = o54
  982. o55.Material = Enum.Material.DiamondPlate
  983. o55.BrickColor = BrickColor.new("Dark stone grey")
  984. o55.Position = Vector3.new(-3.15221953, 4.55396938, 35.912735)
  985. o55.Anchored = true
  986. o55.Size = Vector3.new(14.2800102, 9.27000523, 0.299999863)
  987. o55.CFrame = CFrame.new(-3.15221953, 4.55396938, 35.912735, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  988. o55.BottomSurface = Enum.SurfaceType.Smooth
  989. o55.TopSurface = Enum.SurfaceType.Smooth
  990. o55.Color = Color3.new(0.388235, 0.372549, 0.384314)
  991. o55.Position = Vector3.new(-3.15221953, 4.55396938, 35.912735)
  992. o56.Name = "Open2"
  993. o56.Parent = o54
  994. o56.BrickColor = BrickColor.new("Lime green")
  995. o56.Position = Vector3.new(5.06285286, 7.48103046, 36.3093414)
  996. o56.Anchored = true
  997. o56.Size = Vector3.new(1.5, 1.5, 0.25)
  998. o56.CFrame = CFrame.new(5.06285286, 7.48103046, 36.3093414, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  999. o56.BottomSurface = Enum.SurfaceType.Smooth
  1000. o56.TopSurface = Enum.SurfaceType.Smooth
  1001. o56.Color = Color3.new(0, 0.666667, 0)
  1002. o56.Position = Vector3.new(5.06285286, 7.48103046, 36.3093414)
  1003. o57.Parent = o56
  1004. o57.MaxActivationDistance = 15
  1005. o58.Parent = o56
  1006. table.insert(cors,coroutine.create(function()
  1007. wait()
  1008. runDummyScript(function()
  1009. Door = script.Parent.Parent.Door
  1010. local clickdetector = script.Parent:WaitForChild("ClickDetector")
  1011.  
  1012. clickdetector.MouseClick:Connect(function()
  1013. Door.CanCollide = false
  1014. Door.Transparency = 0.4
  1015. end)
  1016.  
  1017. end,o58)
  1018. end))
  1019. o59.Parent = o56
  1020. o59.Texture = "http://www.roblox.com/asset/?id=67952052"
  1021. o59.Face = Enum.NormalId.Back
  1022. o60.Name = "Close1"
  1023. o60.Parent = o54
  1024. o60.BrickColor = BrickColor.new("Crimson")
  1025. o60.Position = Vector3.new(5.09890938, 5.53103638, 36.4298248)
  1026. o60.Anchored = true
  1027. o60.Size = Vector3.new(1.5, 1.5, 0.25)
  1028. o60.CFrame = CFrame.new(5.09890938, 5.53103638, 36.4298248, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1029. o60.BottomSurface = Enum.SurfaceType.Smooth
  1030. o60.TopSurface = Enum.SurfaceType.Smooth
  1031. o60.Color = Color3.new(0.666667, 0, 0)
  1032. o60.Position = Vector3.new(5.09890938, 5.53103638, 36.4298248)
  1033. o61.Parent = o60
  1034. o61.MaxActivationDistance = 15
  1035. o62.Parent = o60
  1036. table.insert(cors,coroutine.create(function()
  1037. wait()
  1038. runDummyScript(function()
  1039. Door = script.Parent.Parent.Door
  1040. local clickdetector = script.Parent:WaitForChild("ClickDetector")
  1041.  
  1042. clickdetector.MouseClick:Connect(function()
  1043. Door.CanCollide = true
  1044. Door.Transparency = 0
  1045. end)
  1046. end,o62)
  1047. end))
  1048. o63.Parent = o60
  1049. o63.Texture = "http://www.roblox.com/asset/?id=67952435"
  1050. o63.Face = Enum.NormalId.Back
  1051. o64.Name = "Open2"
  1052. o64.Parent = o54
  1053. o64.BrickColor = BrickColor.new("Lime green")
  1054. o64.Position = Vector3.new(-11.777422, 4.91896534, 35.6235504)
  1055. o64.Rotation = Vector3.new(-180, 0, -180)
  1056. o64.Anchored = true
  1057. o64.Size = Vector3.new(1.5, 1.5, 0.25)
  1058. o64.CFrame = CFrame.new(-11.777422, 4.91896534, 35.6235504, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  1059. o64.BottomSurface = Enum.SurfaceType.Smooth
  1060. o64.TopSurface = Enum.SurfaceType.Smooth
  1061. o64.Color = Color3.new(0, 0.666667, 0)
  1062. o64.Position = Vector3.new(-11.777422, 4.91896534, 35.6235504)
  1063. o65.Parent = o64
  1064. o65.MaxActivationDistance = 15
  1065. o66.Parent = o64
  1066. table.insert(cors,coroutine.create(function()
  1067. wait()
  1068. runDummyScript(function()
  1069. Door = script.Parent.Parent.Door
  1070. local clickdetector = script.Parent:WaitForChild("ClickDetector")
  1071.  
  1072. clickdetector.MouseClick:Connect(function()
  1073. Door.CanCollide = false
  1074. Door.Transparency = 0.4
  1075. end)
  1076.  
  1077. end,o66)
  1078. end))
  1079. o67.Parent = o64
  1080. o67.Texture = "http://www.roblox.com/asset/?id=67952052"
  1081. o67.Face = Enum.NormalId.Back
  1082. o68.Name = "Close2"
  1083. o68.Parent = o54
  1084. o68.BrickColor = BrickColor.new("Crimson")
  1085. o68.Position = Vector3.new(-11.8190327, 2.78521252, 35.5709686)
  1086. o68.Rotation = Vector3.new(-180, 0, -180)
  1087. o68.Anchored = true
  1088. o68.Size = Vector3.new(1.5, 1.5, 0.25)
  1089. o68.CFrame = CFrame.new(-11.8190327, 2.78521252, 35.5709686, -1, 0, 0, 0, 1, 0, 0, 0, -1)
  1090. o68.BottomSurface = Enum.SurfaceType.Smooth
  1091. o68.TopSurface = Enum.SurfaceType.Smooth
  1092. o68.Color = Color3.new(0.666667, 0, 0)
  1093. o68.Position = Vector3.new(-11.8190327, 2.78521252, 35.5709686)
  1094. o69.Parent = o68
  1095. o69.MaxActivationDistance = 15
  1096. o70.Parent = o68
  1097. table.insert(cors,coroutine.create(function()
  1098. wait()
  1099. runDummyScript(function()
  1100. --Made by TheCannibalFromMars!
  1101.  
  1102. Door = script.Parent.Parent.Door
  1103. local clickdetector = script.Parent:WaitForChild("ClickDetector")
  1104.  
  1105. clickdetector.MouseClick:Connect(function()
  1106. Door.CanCollide = true
  1107. Door.Transparency = 0
  1108. end)
  1109. end,o70)
  1110. end))
  1111. o71.Parent = o68
  1112. o71.Texture = "http://www.roblox.com/asset/?id=67952435"
  1113. o71.Face = Enum.NormalId.Back
  1114. o72.Parent = mas
  1115. o72.BrickColor = BrickColor.new("Institutional white")
  1116. o72.Position = Vector3.new(-3.11000562, 28.1867142, 46.0611343)
  1117. o72.Anchored = true
  1118. o72.Size = Vector3.new(19.8000011, 0.330000013, 20.6400051)
  1119. o72.CFrame = CFrame.new(-3.11000562, 28.1867142, 46.0611343, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1120. o72.BottomSurface = Enum.SurfaceType.Smooth
  1121. o72.TopSurface = Enum.SurfaceType.Smooth
  1122. o72.Color = Color3.new(0.972549, 0.972549, 0.972549)
  1123. o72.Position = Vector3.new(-3.11000562, 28.1867142, 46.0611343)
  1124. mas.Parent = workspace
  1125. mas:MakeJoints()
  1126. local mas1 = mas:GetChildren()
  1127. for i=1,#mas1 do
  1128. mas1[i].Parent = workspace
  1129. ypcall(function() mas1[i]:MakeJoints() end)
  1130. end
  1131. mas:Destroy()
  1132. for i=1,#cors do
  1133. coroutine.resume(cors[i])
  1134. end
  1135.  
  1136. game:GetService("Lighting").Ambient = Color3.new(0, 0, 0)
  1137. game:GetService("Lighting").Brightness = 2
  1138. game:GetService("Lighting").ColorShift_Bottom = Color3.new(0, 0, 0)
  1139. game:GetService("Lighting").ColorShift_Top = Color3.new(0, 0, 0)
  1140. game:GetService("Lighting").GlobalShadows = true
  1141. game:GetService("Lighting").OutdoorAmbient = Color3.new(0.501961, 0.501961, 0.501961)
  1142. game:GetService("Lighting").Outlines = false
  1143. game:GetService("Lighting").GeographicLatitude = 41.733299255371
  1144. game:GetService("Lighting").TimeOfDay = "14:00:00"
  1145. game:GetService("Lighting").FogColor = Color3.new(0.752941, 0.752941, 0.752941)
  1146. game:GetService("Lighting").FogEnd = 100000
  1147. game:GetService("Lighting").FogStart = 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement