Advertisement
billwa

Physics Gun

Dec 30th, 2015
303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 29.95 KB | None | 0 0
  1. --[[
  2. Objects Skipped: 5
  3.     Localphysics_gun: 2
  4.     TouchTransmitter: 1
  5.     physics_gun: 2
  6. --]]
  7.  
  8. local physics_gun = Instance.new("Tool", game.Players.LocalPlayer.Backpack)
  9. physics_gun.CanBeDropped = false
  10. physics_gun.Name = "Physicsgun"
  11.  
  12. local handle = Instance.new("Part", physics_gun)
  13. handle.FormFactor = Enum.FormFactor.Custom
  14. handle.TopSurface = Enum.SurfaceType.Smooth
  15. handle.Size = Vector3.new(1, 0.4, 0.3)
  16. handle.Name = "Handle"
  17. handle.Locked = true
  18. handle.CFrame = CFrame.new(0.627, 0.543, -3.837)* CFrame.Angles(-0.24700726568699, 0.0029415194876492, -2.730295091169e-005)
  19. handle.BrickColor = BrickColor.new("Cyan")
  20. handle.Friction = 0.3
  21. handle.BottomSurface = Enum.SurfaceType.Smooth
  22.  
  23. local mesh = Instance.new("CylinderMesh", handle)
  24. mesh.Scale = Vector3.new(0.1, 0.1, 0.1)
  25.  
  26. local weld = Instance.new("Weld", handle)
  27. weld.Part1 = h1
  28. weld.Part0 = handle
  29. weld.C1 = CFrame.new(1.375, -90.35, -60.314)* CFrame.Angles(1.570796251297, 0, 1.5707963705063)
  30. weld.C0 = CFrame.new(-60.5, -0.6, 88.6)
  31.  
  32. local weld_2 = Instance.new("Weld", handle)
  33. weld_2.Part1 = h2
  34. weld_2.Part0 = handle
  35. weld_2.C1 = CFrame.new(-58.762, 87.455, 31.494)* CFrame.Angles(-1.570796251297, -0.070856705307961, 0.52359879016876)
  36. weld_2.C0 = CFrame.new(-60.5, -0.6, 88.6)
  37.  
  38. local weld_3 = Instance.new("Weld", handle)
  39. weld_3.Part1 = h3
  40. weld_3.Part0 = handle
  41. weld_3.C1 = CFrame.new(-79.575, -39.156, -60.632)* CFrame.Angles(1.5707961320877, -1.1213386058807, 1.5707961320877)
  42. weld_3.C0 = CFrame.new(-60.5, -0.6, 88.6)
  43.  
  44. local weld_4 = Instance.new("Weld", handle)
  45. weld_4.Part1 = h4
  46. weld_4.Part0 = handle
  47. weld_4.C1 = CFrame.new(89.16, -60.224, -1.26)* CFrame.Angles(1.5707963705063, 1.5707963705063, 0)
  48. weld_4.C0 = CFrame.new(-60.5, -0.6, 88.6)
  49.  
  50. local weld_5 = Instance.new("Weld", handle)
  51. weld_5.Part1 = h5
  52. weld_5.Part0 = handle
  53. weld_5.C1 = CFrame.new(89.16, -60.614, -1.23)* CFrame.Angles(1.5707963705063, 1.5707963705063, 0)
  54. weld_5.C0 = CFrame.new(-60.5, -0.6, 88.6)
  55.  
  56. local weld_6 = Instance.new("Weld", handle)
  57. weld_6.Part1 = h6
  58. weld_6.Part0 = handle
  59. weld_6.C1 = CFrame.new(89.16, -59.954, -1.27)* CFrame.Angles(1.5707963705063, 1.5707963705063, 0)
  60. weld_6.C0 = CFrame.new(-60.5, -0.6, 88.6)
  61.  
  62. local weld_7 = Instance.new("Weld", handle)
  63. weld_7.Part1 = h7
  64. weld_7.Part0 = handle
  65. weld_7.C1 = CFrame.new(89.16, -60.749, -1.235)* CFrame.Angles(1.5707963705063, 1.5707963705063, 0)
  66. weld_7.C0 = CFrame.new(-60.5, -0.6, 88.6)
  67.  
  68. local weld_8 = Instance.new("Weld", handle)
  69. weld_8.Part1 = h8
  70. weld_8.Part0 = handle
  71. weld_8.C1 = CFrame.new(89.16, -60.324, -1.2)* CFrame.Angles(1.5707963705063, 1.5707963705063, 0)
  72. weld_8.C0 = CFrame.new(-60.5, -0.6, 88.6)
  73.  
  74. local weld_9 = Instance.new("Weld", handle)
  75. weld_9.Part1 = h9
  76. weld_9.Part0 = handle
  77. weld_9.C1 = CFrame.new(89.16, -60.914, -1.2)* CFrame.Angles(1.5707963705063, 1.5707963705063, 0)
  78. weld_9.C0 = CFrame.new(-60.5, -0.6, 88.6)
  79.  
  80. local weld_10 = Instance.new("Weld", handle)
  81. weld_10.Part1 = h10
  82. weld_10.Part0 = handle
  83. weld_10.C1 = CFrame.new(89.16, -60.499, -1.225)* CFrame.Angles(1.5707963705063, 1.5707963705063, 0)
  84. weld_10.C0 = CFrame.new(-60.5, -0.6, 88.6)
  85.  
  86. local weld_11 = Instance.new("Weld", handle)
  87. weld_11.Part1 = h11
  88. weld_11.Part0 = handle
  89. weld_11.C1 = CFrame.new(1.23, -89.62, -60.634)* CFrame.Angles(1.570796251297, 0, 1.5707963705063)
  90. weld_11.C0 = CFrame.new(-60.5, -0.6, 88.6)
  91.  
  92. local weld_12 = Instance.new("Weld", handle)
  93. weld_12.Part1 = h12
  94. weld_12.Part0 = handle
  95. weld_12.C1 = CFrame.new(53.525, 95.385, -1.12)* CFrame.Angles(-1.5707963705063, -0.070857055485249, -3.1415927410126)
  96. weld_12.C0 = CFrame.new(-60.5, -0.6, 88.6)
  97.  
  98. local weld_13 = Instance.new("Weld", handle)
  99. weld_13.Part1 = h13
  100. weld_13.Part0 = handle
  101. weld_13.C1 = CFrame.new(0.995, -90.35, -60.384)* CFrame.Angles(1.570796251297, 0, 1.5707963705063)
  102. weld_13.C0 = CFrame.new(-60.5, -0.6, 88.6)
  103.  
  104. local weld_14 = Instance.new("Weld", handle)
  105. weld_14.Part1 = h14
  106. weld_14.Part0 = handle
  107. weld_14.C1 = CFrame.new(104.415, 31.682, -1.13)* CFrame.Angles(-1.570796251297, 0.69126671552658, 3.141592502594)
  108. weld_14.C0 = CFrame.new(-60.5, -0.6, 88.6)
  109.  
  110. local weld_15 = Instance.new("Weld", handle)
  111. weld_15.Part1 = h15
  112. weld_15.Part0 = handle
  113. weld_15.C1 = CFrame.new(17.716, 103.475, 31.483)* CFrame.Angles(-1.5707961320877, 0.69126707315445, 0.52359837293625)
  114. weld_15.C0 = CFrame.new(-60.5, -0.6, 88.6)
  115.  
  116. local weld_16 = Instance.new("Weld", handle)
  117. weld_16.Part1 = h16
  118. weld_16.Part0 = handle
  119. weld_16.C1 = CFrame.new(-10.942, 90.809, -60.458)* CFrame.Angles(-1.570796251297, -0.070856980979443, -1.5244005918503)
  120. weld_16.C0 = CFrame.new(-60.5, -0.6, 88.6)
  121.  
  122. local weld_17 = Instance.new("Weld", handle)
  123. weld_17.Part1 = h17
  124. weld_17.Part0 = handle
  125. weld_17.C1 = CFrame.new(54.622, 72.884, -60.468)* CFrame.Angles(-1.5707961320877, 0.69126683473587, -1.5244011878967)
  126. weld_17.C0 = CFrame.new(-60.5, -0.6, 88.6)
  127.  
  128. local weld_18 = Instance.new("Weld", handle)
  129. weld_18.Part1 = h18
  130. weld_18.Part0 = handle
  131. weld_18.C1 = CFrame.new(-1.045, 90.35, -60.894)* CFrame.Angles(-1.570796251297, 0, -1.5707963705063)
  132. weld_18.C0 = CFrame.new(-60.5, -0.6, 88.6)
  133.  
  134. local weld_19 = Instance.new("Weld", handle)
  135. weld_19.Part1 = h19
  136. weld_19.Part0 = handle
  137. weld_19.C1 = CFrame.new(1.23, -90.92, -60.634)* CFrame.Angles(1.570796251297, 0, 1.5707963705063)
  138. weld_19.C0 = CFrame.new(-60.5, -0.6, 88.6)
  139.  
  140. local weld_20 = Instance.new("Weld", handle)
  141. weld_20.Part1 = h20
  142. weld_20.Part0 = handle
  143. weld_20.C1 = CFrame.new(60.634, 90.66, -1.21)* CFrame.Angles(-1.5707963705063, -7.5497894158616e-008, -3.1415927410126)
  144. weld_20.C0 = CFrame.new(-60.5, -0.6, 88.6)
  145.  
  146. local weld_21 = Instance.new("Weld", handle)
  147. weld_21.Part1 = h21
  148. weld_21.Part0 = handle
  149. weld_21.C1 = CFrame.new(-0.915, 90.35, -60.774)* CFrame.Angles(-1.570796251297, 0, -1.5707963705063)
  150. weld_21.C0 = CFrame.new(-60.5, -0.6, 88.6)
  151.  
  152. local weld_22 = Instance.new("Weld", handle)
  153. weld_22.Part1 = h22
  154. weld_22.Part0 = handle
  155. weld_22.C1 = CFrame.new(-1.221, 90.82, -60.626)* CFrame.Angles(-1.570796251297, 0, -1.5707963705063)
  156. weld_22.C0 = CFrame.new(-60.5, -0.6, 88.6)
  157.  
  158. local weld_23 = Instance.new("Weld", handle)
  159. weld_23.Part1 = h23
  160. weld_23.Part0 = handle
  161. weld_23.C1 = CFrame.new(-1.231, -90.89, 60.626)* CFrame.Angles(1.5707963705063, 0, -1.5707963705063)
  162. weld_23.C0 = CFrame.new(-60.5, -0.6, 88.6)
  163.  
  164. local weld_24 = Instance.new("Weld", handle)
  165. weld_24.Part1 = h24
  166. weld_24.Part0 = handle
  167. weld_24.C1 = CFrame.new(1.565, -90.35, -60.614)* CFrame.Angles(1.570796251297, 0, 1.5707963705063)
  168. weld_24.C0 = CFrame.new(-60.5, -0.6, 88.6)
  169.  
  170. local weld_25 = Instance.new("Weld", handle)
  171. weld_25.Part1 = h25
  172. weld_25.Part0 = handle
  173. weld_25.C1 = CFrame.new(1.505, -90.35, -60.824)* CFrame.Angles(1.570796251297, 0, 1.5707963705063)
  174. weld_25.C0 = CFrame.new(-60.5, -0.6, 88.6)
  175.  
  176. local weld_26 = Instance.new("Weld", handle)
  177. weld_26.Part1 = h26
  178. weld_26.Part0 = handle
  179. weld_26.C1 = CFrame.new(1.375, -90.35, -60.944)* CFrame.Angles(1.570796251297, 0, 1.5707963705063)
  180. weld_26.C0 = CFrame.new(-60.5, -0.6, 88.6)
  181.  
  182. local weld_27 = Instance.new("Weld", handle)
  183. weld_27.Part1 = h27
  184. weld_27.Part0 = handle
  185. weld_27.C1 = CFrame.new(1.495, -90.35, -60.404)* CFrame.Angles(1.570796251297, 0, 1.5707963705063)
  186. weld_27.C0 = CFrame.new(-60.5, -0.6, 88.6)
  187.  
  188. local weld_28 = Instance.new("Weld", handle)
  189. weld_28.Part1 = h28
  190. weld_28.Part0 = handle
  191. weld_28.C1 = CFrame.new(0.885, -90.32, -60.614)* CFrame.Angles(1.570796251297, 0, 1.5707963705063)
  192. weld_28.C0 = CFrame.new(-60.5, -0.6, 88.6)
  193.  
  194. local weld_29 = Instance.new("Weld", handle)
  195. weld_29.Part1 = h29
  196. weld_29.Part0 = handle
  197. weld_29.C1 = CFrame.new(1.225, -90.195, -60.634)* CFrame.Angles(1.570796251297, 0, 1.5707963705063)
  198. weld_29.C0 = CFrame.new(-60.5, -0.6, 88.6)
  199.  
  200. local h1 = Instance.new("Part", physics_gun)
  201. h1.FormFactor = Enum.FormFactor.Custom
  202. h1.TopSurface = Enum.SurfaceType.Smooth
  203. h1.Size = Vector3.new(0.2, 1.17, 0.2)
  204. h1.Name = "H1"
  205. h1.Locked = true
  206. h1.CFrame = CFrame.new(0.436, 0.867, -5.723)* CFrame.Angles(2.8853034973145, 1.5678666830063, 1.5800782442093)
  207. h1.Friction = 0.3
  208. h1.BottomSurface = Enum.SurfaceType.Smooth
  209.  
  210. local mesh_2 = Instance.new("CylinderMesh", h1)
  211. mesh_2.Scale = Vector3.new(1, 1, 0.25)
  212.  
  213. local h2 = Instance.new("Part", physics_gun)
  214. h2.FormFactor = Enum.FormFactor.Custom
  215. h2.TopSurface = Enum.SurfaceType.Smooth
  216. h2.Size = Vector3.new(0.2, 0.5, 0.2)
  217. h2.Name = "H2"
  218. h2.Locked = true
  219. h2.CFrame = CFrame.new(1.265, 0.308, -6.663)* CFrame.Angles(1.3220906257629, -0.52362334728241, -0.074253365397453)
  220. h2.Friction = 0.3
  221. h2.BottomSurface = Enum.SurfaceType.Smooth
  222.  
  223. local mesh_3 = Instance.new("CylinderMesh", h2)
  224. mesh_3.Scale = Vector3.new(0.5, 1, 1)
  225.  
  226. local h3 = Instance.new("Part", physics_gun)
  227. h3.FormFactor = Enum.FormFactor.Custom
  228. h3.TopSurface = Enum.SurfaceType.Smooth
  229. h3.Size = Vector3.new(0.46, 1.25, 0.38)
  230. h3.Name = "H3"
  231. h3.Locked = true
  232. h3.CFrame = CFrame.new(0.759, 0.614, -3.942)* CFrame.Angles(2.8853034973145, 1.5678666830063, 2.7014172077179)
  233. h3.BrickColor = BrickColor.new("Dark stone grey")
  234. h3.Friction = 0.3
  235. h3.BottomSurface = Enum.SurfaceType.Smooth
  236.  
  237. local mesh_4 = Instance.new("SpecialMesh", h3)
  238. mesh_4.MeshType = Enum.MeshType.Brick
  239.  
  240. local mesh_5 = Instance.new("CylinderMesh", h3)
  241.  
  242. local h4 = Instance.new("Part", physics_gun)
  243. h4.FormFactor = Enum.FormFactor.Custom
  244. h4.TopSurface = Enum.SurfaceType.Smooth
  245. h4.Size = Vector3.new(1, 0.2, 0.5)
  246. h4.Name = "H4"
  247. h4.Locked = true
  248. h4.CFrame = CFrame.new(0.35, 1.047, -4.54)* CFrame.Angles(-1.8178036212921, 2.7302834496368e-005, -1.5678548812866)
  249. h4.Friction = 0.3
  250. h4.BottomSurface = Enum.SurfaceType.Smooth
  251.  
  252. local mesh_6 = Instance.new("SpecialMesh", h4)
  253. mesh_6.MeshType = Enum.MeshType.Brick
  254.  
  255. local mesh_7 = Instance.new("CylinderMesh", h4)
  256.  
  257. local h5 = Instance.new("Part", physics_gun)
  258. h5.FormFactor = Enum.FormFactor.Plate
  259. h5.TopSurface = Enum.SurfaceType.Smooth
  260. h5.Size = Vector3.new(1, 0.4, 1)
  261. h5.Name = "H5"
  262. h5.Locked = true
  263. h5.CFrame = CFrame.new(0.74, 1.017, -4.534)* CFrame.Angles(-1.8178036212921, 2.7302834496368e-005, -1.5678548812866)
  264. h5.BrickColor = BrickColor.new("Dark stone grey")
  265. h5.Friction = 0.3
  266. h5.BottomSurface = Enum.SurfaceType.Smooth
  267.  
  268. local mesh_8 = Instance.new("SpecialMesh", h5)
  269. mesh_8.MeshType = Enum.MeshType.Brick
  270.  
  271. local mesh_9 = Instance.new("CylinderMesh", h5)
  272.  
  273. local h6 = Instance.new("Part", physics_gun)
  274. h6.FormFactor = Enum.FormFactor.Custom
  275. h6.TopSurface = Enum.SurfaceType.Smooth
  276. h6.Size = Vector3.new(1, 0.74, 0.22)
  277. h6.Name = "H6"
  278. h6.Locked = true
  279. h6.CFrame = CFrame.new(0.08, 1.057, -4.542)* CFrame.Angles(-1.8178036212921, 2.7302834496368e-005, -1.5678548812866)
  280. h6.BrickColor = BrickColor.new("Dark stone grey")
  281. h6.Friction = 0.3
  282. h6.BottomSurface = Enum.SurfaceType.Smooth
  283.  
  284. local mesh_10 = Instance.new("SpecialMesh", h6)
  285. mesh_10.MeshType = Enum.MeshType.Brick
  286.  
  287. local mesh_11 = Instance.new("CylinderMesh", h6)
  288.  
  289. local h7 = Instance.new("Part", physics_gun)
  290. h7.FormFactor = Enum.FormFactor.Custom
  291. h7.TopSurface = Enum.SurfaceType.Smooth
  292. h7.Size = Vector3.new(1, 0.39, 1.01)
  293. h7.Name = "H7"
  294. h7.Locked = true
  295. h7.CFrame = CFrame.new(0.875, 1.022, -4.536)* CFrame.Angles(-1.8178036212921, 2.7302834496368e-005, -1.5678548812866)
  296. h7.Friction = 0.3
  297. h7.BottomSurface = Enum.SurfaceType.Smooth
  298.  
  299. local mesh_12 = Instance.new("CylinderMesh", h7)
  300. mesh_12.Scale = Vector3.new(1.1, 0.5, 1.1)
  301.  
  302. local h8 = Instance.new("Part", physics_gun)
  303. h8.FormFactor = Enum.FormFactor.Custom
  304. h8.TopSurface = Enum.SurfaceType.Smooth
  305. h8.Size = Vector3.new(1, 0.2, 0.92)
  306. h8.Name = "H8"
  307. h8.Locked = true
  308. h8.CFrame = CFrame.new(0.45, 0.988, -4.526)* CFrame.Angles(-1.8178036212921, 2.7302834496368e-005, -1.5678548812866)
  309. h8.Friction = 0.3
  310. h8.BottomSurface = Enum.SurfaceType.Smooth
  311.  
  312. local mesh_13 = Instance.new("SpecialMesh", h8)
  313. mesh_13.MeshType = Enum.MeshType.Brick
  314.  
  315. local mesh_14 = Instance.new("CylinderMesh", h8)
  316.  
  317. local h9 = Instance.new("Part", physics_gun)
  318. h9.FormFactor = Enum.FormFactor.Custom
  319. h9.TopSurface = Enum.SurfaceType.Smooth
  320. h9.Size = Vector3.new(1, 0.2, 0.92)
  321. h9.Name = "H9"
  322. h9.Locked = true
  323. h9.CFrame = CFrame.new(1.04, 0.988, -4.528)* CFrame.Angles(-1.8178036212921, 2.7302834496368e-005, -1.5678548812866)
  324. h9.Friction = 0.3
  325. h9.BottomSurface = Enum.SurfaceType.Smooth
  326.  
  327. local mesh_15 = Instance.new("SpecialMesh", h9)
  328. mesh_15.MeshType = Enum.MeshType.Brick
  329.  
  330. local mesh_16 = Instance.new("CylinderMesh", h9)
  331.  
  332. local h10 = Instance.new("Part", physics_gun)
  333. h10.FormFactor = Enum.FormFactor.Custom
  334. h10.TopSurface = Enum.SurfaceType.Smooth
  335. h10.Size = Vector3.new(1, 0.39, 1.01)
  336. h10.Name = "H10"
  337. h10.Locked = true
  338. h10.CFrame = CFrame.new(0.625, 1.013, -4.533)* CFrame.Angles(-1.8178036212921, 2.7302834496368e-005, -1.5678548812866)
  339. h10.Friction = 0.3
  340. h10.BottomSurface = Enum.SurfaceType.Smooth
  341.  
  342. local mesh_17 = Instance.new("CylinderMesh", h10)
  343. mesh_17.Scale = Vector3.new(1.1, 0.5, 1.1)
  344.  
  345. local h11 = Instance.new("Part", physics_gun)
  346. h11.FormFactor = Enum.FormFactor.Custom
  347. h11.TopSurface = Enum.SurfaceType.Smooth
  348. h11.Size = Vector3.new(0.84, 0.52, 0.76)
  349. h11.Name = "H11"
  350. h11.Locked = true
  351. h11.CFrame = CFrame.new(0.759, 0.905, -4.98)* CFrame.Angles(2.8853034973145, 1.5678666830063, 1.5800782442093)
  352. h11.Friction = 0.3
  353. h11.BottomSurface = Enum.SurfaceType.Smooth
  354.  
  355. local mesh_18 = Instance.new("SpecialMesh", h11)
  356. mesh_18.MeshType = Enum.MeshType.Brick
  357.  
  358. local mesh_19 = Instance.new("CylinderMesh", h11)
  359.  
  360. local h12 = Instance.new("Part", physics_gun)
  361. h12.FormFactor = Enum.FormFactor.Custom
  362. h12.TopSurface = Enum.SurfaceType.Smooth
  363. h12.Size = Vector3.new(0.2, 0.5, 0.2)
  364. h12.Name = "H12"
  365. h12.Locked = true
  366. h12.CFrame = CFrame.new(0.263, 0.374, -6.635)* CFrame.Angles(-1.8178036212921, 2.7302834496368e-005, 3.0736770629883)
  367. h12.Friction = 0.3
  368. h12.BottomSurface = Enum.SurfaceType.Smooth
  369.  
  370. local mesh_20 = Instance.new("CylinderMesh", h12)
  371. mesh_20.Scale = Vector3.new(0.5, 1, 1)
  372.  
  373. local h13 = Instance.new("Part", physics_gun)
  374. h13.FormFactor = Enum.FormFactor.Custom
  375. h13.TopSurface = Enum.SurfaceType.Smooth
  376. h13.Size = Vector3.new(0.2, 1.17, 0.2)
  377. h13.Name = "H13"
  378. h13.Locked = true
  379. h13.CFrame = CFrame.new(0.506, 0.499, -5.63)* CFrame.Angles(2.8853034973145, 1.5678666830063, 1.5800782442093)
  380. h13.Friction = 0.3
  381. h13.BottomSurface = Enum.SurfaceType.Smooth
  382.  
  383. local mesh_21 = Instance.new("CylinderMesh", h13)
  384. mesh_21.Scale = Vector3.new(1, 1, 0.25)
  385.  
  386. local h14 = Instance.new("Part", physics_gun)
  387. h14.FormFactor = Enum.FormFactor.Custom
  388. h14.TopSurface = Enum.SurfaceType.Smooth
  389. h14.Size = Vector3.new(0.2, 0.43, 0.2)
  390. h14.Name = "H14"
  391. h14.Locked = true
  392. h14.CFrame = CFrame.new(0.369, 0.477, -6.269)* CFrame.Angles(-1.8178036212921, 2.711408342293e-005, -2.4473848342896)
  393. h14.Friction = 0.3
  394. h14.BottomSurface = Enum.SurfaceType.Smooth
  395.  
  396. local mesh_22 = Instance.new("CylinderMesh", h14)
  397. mesh_22.Scale = Vector3.new(0.5, 1, 1)
  398.  
  399. local h15 = Instance.new("Part", physics_gun)
  400. h15.FormFactor = Enum.FormFactor.Custom
  401. h15.TopSurface = Enum.SurfaceType.Smooth
  402. h15.Size = Vector3.new(0.2, 0.43, 0.2)
  403. h15.Name = "H15"
  404. h15.Locked = true
  405. h15.CFrame = CFrame.new(1.17, 0.443, -6.304)* CFrame.Angles(1.3220906257629, -0.52362316846848, 0.68786984682083)
  406. h15.Friction = 0.3
  407. h15.BottomSurface = Enum.SurfaceType.Smooth
  408.  
  409. local mesh_23 = Instance.new("CylinderMesh", h15)
  410. mesh_23.Scale = Vector3.new(0.5, 1, 1)
  411.  
  412. local h16 = Instance.new("Part", physics_gun)
  413. h16.FormFactor = Enum.FormFactor.Custom
  414. h16.TopSurface = Enum.SurfaceType.Smooth
  415. h16.Size = Vector3.new(0.2, 0.5, 0.2)
  416. h16.Name = "H16"
  417. h16.Locked = true
  418. h16.CFrame = CFrame.new(0.72, 0.914, -6.773)* CFrame.Angles(1.3870207071304, 1.5242797136307, -0.13415695726871)
  419. h16.Friction = 0.3
  420. h16.BottomSurface = Enum.SurfaceType.Smooth
  421.  
  422. local mesh_24 = Instance.new("CylinderMesh", h16)
  423. mesh_24.Scale = Vector3.new(0.5, 1, 1)
  424.  
  425. local h17 = Instance.new("Part", physics_gun)
  426. h17.FormFactor = Enum.FormFactor.Custom
  427. h17.TopSurface = Enum.SurfaceType.Smooth
  428. h17.Size = Vector3.new(0.2, 0.43, 0.2)
  429. h17.Name = "H17"
  430. h17.Locked = true
  431. h17.CFrame = CFrame.new(0.727, 0.906, -6.378)* CFrame.Angles(1.3870195150375, 1.5242809057236, 0.627969622612)
  432. h17.Friction = 0.3
  433. h17.BottomSurface = Enum.SurfaceType.Smooth
  434.  
  435. local mesh_25 = Instance.new("CylinderMesh", h17)
  436. mesh_25.Scale = Vector3.new(0.5, 1, 1)
  437.  
  438. local h18 = Instance.new("Part", physics_gun)
  439. h18.FormFactor = Enum.FormFactor.Custom
  440. h18.TopSurface = Enum.SurfaceType.Smooth
  441. h18.Size = Vector3.new(0.2, 1.17, 0.2)
  442. h18.Name = "H18"
  443. h18.Locked = true
  444. h18.CFrame = CFrame.new(1.016, 0.547, -5.644)* CFrame.Angles(2.8853034973145, 1.5678666830063, -1.5615144968033)
  445. h18.Friction = 0.3
  446. h18.BottomSurface = Enum.SurfaceType.Smooth
  447.  
  448. local mesh_26 = Instance.new("CylinderMesh", h18)
  449. mesh_26.Scale = Vector3.new(1, 1, 0.25)
  450.  
  451. local h19 = Instance.new("Part", physics_gun)
  452. h19.FormFactor = Enum.FormFactor.Custom
  453. h19.TopSurface = Enum.SurfaceType.Smooth
  454. h19.Size = Vector3.new(0.84, 0.2, 0.76)
  455. h19.Name = "H19"
  456. h19.Locked = true
  457. h19.CFrame = CFrame.new(0.755, 0.587, -6.241)* CFrame.Angles(2.8853034973145, 1.5678666830063, 1.5800782442093)
  458. h19.Friction = 0.3
  459. h19.BottomSurface = Enum.SurfaceType.Smooth
  460.  
  461. local mesh_27 = Instance.new("CylinderMesh", h19)
  462.  
  463. local h20 = Instance.new("Part", physics_gun)
  464. h20.FormFactor = Enum.FormFactor.Custom
  465. h20.TopSurface = Enum.SurfaceType.Smooth
  466. h20.Reflectance = 0.3
  467. h20.Size = Vector3.new(1, 0.74, 0.22)
  468. h20.Name = "H20"
  469. h20.Locked = true
  470. h20.CFrame = CFrame.new(0.755, 0.631, -5.984)* CFrame.Angles(-1.8178036212921, 2.7302834496368e-005, -3.1386511325836)
  471. h20.BrickColor = BrickColor.new("Teal")
  472. h20.Friction = 0.3
  473. h20.BottomSurface = Enum.SurfaceType.Smooth
  474.  
  475. local mesh_28 = Instance.new("SpecialMesh", h20)
  476. mesh_28.MeshType = Enum.MeshType.Brick
  477.  
  478. local mesh_29 = Instance.new("CylinderMesh", h20)
  479.  
  480. local h21 = Instance.new("Part", physics_gun)
  481. h21.FormFactor = Enum.FormFactor.Custom
  482. h21.TopSurface = Enum.SurfaceType.Smooth
  483. h21.Size = Vector3.new(0.2, 1.17, 0.2)
  484. h21.Name = "H21"
  485. h21.Locked = true
  486. h21.CFrame = CFrame.new(0.896, 0.421, -5.611)* CFrame.Angles(2.8853034973145, 1.5678666830063, -1.5615144968033)
  487. h21.Friction = 0.3
  488. h21.BottomSurface = Enum.SurfaceType.Smooth
  489.  
  490. local mesh_30 = Instance.new("CylinderMesh", h21)
  491. mesh_30.Scale = Vector3.new(1, 1, 0.25)
  492.  
  493. local h22 = Instance.new("Part", physics_gun)
  494. h22.FormFactor = Enum.FormFactor.Custom
  495. h22.TopSurface = Enum.SurfaceType.Smooth
  496. h22.Reflectance = 0.3
  497. h22.Size = Vector3.new(1, 1, 1)
  498. h22.Name = "H22"
  499. h22.Locked = true
  500. h22.CFrame = CFrame.new(0.747, 0.603, -6.142)* CFrame.Angles(2.8853034973145, 1.5678666830063, -1.5615144968033)
  501. h22.BrickColor = BrickColor.new("Teal")
  502. h22.Friction = 0.3
  503. h22.BottomSurface = Enum.SurfaceType.Smooth
  504.  
  505. local mesh_31 = Instance.new("SpecialMesh", h22)
  506. mesh_31.Scale = Vector3.new(0.5, 0.5, 0.5)
  507. mesh_31.MeshId = "http://www.roblox.com/asset/?id=1031410"
  508. mesh_31.MeshType = Enum.MeshType.FileMesh
  509.  
  510. local h23 = Instance.new("Part", physics_gun)
  511. h23.FormFactor = Enum.FormFactor.Custom
  512. h23.TopSurface = Enum.SurfaceType.Smooth
  513. h23.Reflectance = 0.3
  514. h23.Size = Vector3.new(1, 1, 1)
  515. h23.Name = "H23"
  516. h23.Locked = true
  517. h23.CFrame = CFrame.new(0.747, 0.595, -6.212)* CFrame.Angles(-0.25628915429115, -1.5678666830063, 1.5615144968033)
  518. h23.BrickColor = BrickColor.new("Teal")
  519. h23.Friction = 0.3
  520. h23.BottomSurface = Enum.SurfaceType.Smooth
  521.  
  522. local mesh_32 = Instance.new("SpecialMesh", h23)
  523. mesh_32.Scale = Vector3.new(0.3, 0.3, 0.3)
  524. mesh_32.MeshId = "http://www.roblox.com/asset/?id=1031410"
  525. mesh_32.MeshType = Enum.MeshType.FileMesh
  526.  
  527. local h24 = Instance.new("Part", physics_gun)
  528. h24.FormFactor = Enum.FormFactor.Custom
  529. h24.TopSurface = Enum.SurfaceType.Smooth
  530. h24.Size = Vector3.new(0.2, 1.17, 0.2)
  531. h24.Name = "H24"
  532. h24.Locked = true
  533. h24.CFrame = CFrame.new(0.736, 1.051, -5.77)* CFrame.Angles(2.8853034973145, 1.5678666830063, 1.5800782442093)
  534. h24.Friction = 0.3
  535. h24.BottomSurface = Enum.SurfaceType.Smooth
  536.  
  537. local mesh_33 = Instance.new("CylinderMesh", h24)
  538. mesh_33.Scale = Vector3.new(1, 1, 0.25)
  539.  
  540. local h25 = Instance.new("Part", physics_gun)
  541. h25.FormFactor = Enum.FormFactor.Custom
  542. h25.TopSurface = Enum.SurfaceType.Smooth
  543. h25.Size = Vector3.new(0.2, 1.17, 0.2)
  544. h25.Name = "H25"
  545. h25.Locked = true
  546. h25.CFrame = CFrame.new(0.946, 0.993, -5.756)* CFrame.Angles(2.8853034973145, 1.5678666830063, 1.5800782442093)
  547. h25.Friction = 0.3
  548. h25.BottomSurface = Enum.SurfaceType.Smooth
  549.  
  550. local mesh_34 = Instance.new("CylinderMesh", h25)
  551. mesh_34.Scale = Vector3.new(1, 1, 0.25)
  552.  
  553. local h26 = Instance.new("Part", physics_gun)
  554. h26.FormFactor = Enum.FormFactor.Custom
  555. h26.TopSurface = Enum.SurfaceType.Smooth
  556. h26.Size = Vector3.new(0.2, 1.17, 0.2)
  557. h26.Name = "H26"
  558. h26.Locked = true
  559. h26.CFrame = CFrame.new(1.066, 0.867, -5.724)* CFrame.Angles(2.8853034973145, 1.5678666830063, 1.5800782442093)
  560. h26.Friction = 0.3
  561. h26.BottomSurface = Enum.SurfaceType.Smooth
  562.  
  563. local mesh_35 = Instance.new("CylinderMesh", h26)
  564. mesh_35.Scale = Vector3.new(1, 1, 0.25)
  565.  
  566. local h27 = Instance.new("Part", physics_gun)
  567. h27.FormFactor = Enum.FormFactor.Custom
  568. h27.TopSurface = Enum.SurfaceType.Smooth
  569. h27.Size = Vector3.new(0.2, 1.17, 0.2)
  570. h27.Name = "H27"
  571. h27.Locked = true
  572. h27.CFrame = CFrame.new(0.526, 0.984, -5.752)* CFrame.Angles(2.8853034973145, 1.5678666830063, 1.5800782442093)
  573. h27.Friction = 0.3
  574. h27.BottomSurface = Enum.SurfaceType.Smooth
  575.  
  576. local mesh_36 = Instance.new("CylinderMesh", h27)
  577. mesh_36.Scale = Vector3.new(1, 1, 0.25)
  578.  
  579. local h28 = Instance.new("Part", physics_gun)
  580. h28.FormFactor = Enum.FormFactor.Custom
  581. h28.TopSurface = Enum.SurfaceType.Smooth
  582. h28.Size = Vector3.new(0.2, 1.17, 0.2)
  583. h28.Name = "H28"
  584. h28.Locked = true
  585. h28.CFrame = CFrame.new(0.736, 0.399, -5.575)* CFrame.Angles(2.8853034973145, 1.5678666830063, 1.5800782442093)
  586. h28.Friction = 0.3
  587. h28.BottomSurface = Enum.SurfaceType.Smooth
  588.  
  589. local mesh_37 = Instance.new("CylinderMesh", h28)
  590. mesh_37.Scale = Vector3.new(1, 1, 0.25)
  591.  
  592. local h29 = Instance.new("Part", physics_gun)
  593. h29.FormFactor = Enum.FormFactor.Custom
  594. h29.TopSurface = Enum.SurfaceType.Smooth
  595. h29.Reflectance = 0.3
  596. h29.Size = Vector3.new(0.65, 1.61, 0.76)
  597. h29.Name = "H29"
  598. h29.Locked = true
  599. h29.CFrame = CFrame.new(0.757, 0.759, -5.537)* CFrame.Angles(2.8853034973145, 1.5678666830063, 1.5800782442093)
  600. h29.BrickColor = BrickColor.new("Teal")
  601. h29.Friction = 0.3
  602. h29.BottomSurface = Enum.SurfaceType.Smooth
  603.  
  604. local mesh_38 = Instance.new("SpecialMesh", h29)
  605. mesh_38.MeshType = Enum.MeshType.Brick
  606.  
  607. local mesh_39 = Instance.new("CylinderMesh", h29)
  608.  
  609. wait()
  610. tool = physics_gun
  611. lineconnect = physics_gun
  612. object = nil
  613. mousedown = false
  614. found = false
  615. BP = Instance.new("BodyPosition")
  616. BP.maxForce = Vector3.new(math.huge*math.huge,math.huge*math.huge,math.huge*math.huge) --pwns everyone elses bodyposition
  617. BP.P = BP.P*8 --faster movement. less bounceback.
  618. dist = nil
  619. point = Instance.new("Part")
  620. point.Locked = true
  621. point.Anchored = true
  622. point.formFactor = 0
  623. point.Shape = 0
  624. point.BrickColor = BrickColor.new("Toothpaste")
  625. point.Size = Vector3.new(1,1,1)
  626. point.CanCollide = false
  627. local mesh = Instance.new("SpecialMesh")
  628. mesh.MeshType = "Sphere"
  629. mesh.Scale = Vector3.new(.7,.7,.7)
  630. mesh.Parent = point
  631. handle = tool.Handle
  632. front = tool.Handle
  633. color = tool.Handle
  634. objval = nil
  635. local hooked = false
  636. local hookBP = BP:clone()
  637. hookBP.maxForce = Vector3.new(30000,30000,30000)
  638.  
  639. function LineConnect(part1,part2,parent)
  640.     local p1 = Instance.new("ObjectValue")
  641.     p1.Value = part1
  642.     p1.Name = "Part1"
  643.     local p2 = Instance.new("ObjectValue")
  644.     p2.Value = part2
  645.     p2.Name = "Part2"
  646.     local par = Instance.new("ObjectValue")
  647.     par.Value = parent
  648.     par.Name = "Par"
  649.     local col = Instance.new("ObjectValue")
  650.     col.Value = color
  651.     col.Name = "Color"
  652.     local s = lineconnect:clone()
  653.     s.Disabled = false
  654.     p1.Parent = s
  655.     p2.Parent = s
  656.     par.Parent = s
  657.     col.Parent = s
  658.     s.Parent = workspace
  659.     if (part2==object) then
  660.         objval = p2
  661.     end
  662. end
  663.  
  664. function onButton1Down(mouse)
  665.     if (mousedown==true) then return end
  666.     mousedown = true
  667.     coroutine.resume(coroutine.create(function()
  668.         local p = point:clone()
  669.         p.Parent = tool
  670.         LineConnect(front,p,workspace)
  671.         while (mousedown==true) do
  672.             p.Parent = tool
  673.             if (object==nil) then
  674.                 if (mouse.Target==nil) then
  675.                     local lv = CFrame.new(front.Position,mouse.Hit.p)
  676.                     p.CFrame = CFrame.new(front.Position+(lv.lookVector*1000))
  677.                 else
  678.                     p.CFrame = CFrame.new(mouse.Hit.p)
  679.                 end
  680.             else
  681.                 LineConnect(front,object,workspace)
  682.                 break
  683.             end
  684.             wait()
  685.         end
  686.         p:remove()
  687.     end))
  688.     while (mousedown==true) do
  689.         if (mouse.Target~=nil) then
  690.             local t = mouse.Target
  691.             if (t.Anchored==false) then
  692.                 object = t
  693.                 dist = (object.Position-front.Position).magnitude
  694.                 break
  695.             end
  696.         end
  697.         wait()
  698.     end
  699.     while (mousedown==true) do
  700.         if (object.Parent==nil) then break end
  701.         local lv = CFrame.new(front.Position,mouse.Hit.p)
  702.         BP.Parent = object
  703.         BP.position = front.Position+lv.lookVector*dist
  704.         wait()
  705.     end
  706.     BP:remove()
  707.     object = nil
  708.     objval.Value = nil
  709. end
  710.  
  711. function onKeyDown(key,mouse)
  712.     local key = key:lower()
  713.     local yesh = false
  714.     if (key=="") then
  715.         if (dist>=5) then
  716.             dist = dist-5
  717.         end
  718.     end
  719.     if key == "" then
  720.     if (object==nil) then return end
  721.     for _,v in pairs(object:children()) do
  722.     if v.className == "BodyGyro" then
  723.     return nil
  724.     end
  725.     end
  726.     BG = Instance.new("BodyGyro")
  727.     BG.maxTorque = Vector3.new(math.huge,math.huge,math.huge)
  728.     BG.cframe = CFrame.new(object.CFrame.p)
  729.     BG.Parent = object
  730.     repeat wait() until(object.CFrame == CFrame.new(object.CFrame.p))
  731.     BG.Parent = nil
  732.     if (object==nil) then return end
  733.     for _,v in pairs(object:children()) do
  734.     if v.className == "BodyGyro" then
  735.     v.Parent = nil
  736.     end
  737.     end
  738.     object.Velocity = Vector3.new(0,0,0)
  739.     object.RotVelocity = Vector3.new(0,0,0)
  740.     end
  741.     if (key=="") then
  742.         dist = dist+5
  743.     end
  744.     if (string.byte(key)==27) then
  745.         if (object==nil) then return end
  746.         local e = Instance.new("Explosion")
  747.         e.Parent = workspace
  748.         e.Position = object.Position
  749.         color.BrickColor = BrickColor.Black()
  750.         point.BrickColor = BrickColor.White()
  751.         wait(.48)
  752.         color.BrickColor = BrickColor.White()
  753.         point.BrickColor = BrickColor.Black()
  754.     end
  755.     if (key=="") then
  756.         if not hooked then
  757.         if (object==nil) then return end
  758.         hooked = true
  759.         hookBP.position = object.Position
  760.         if tool.Parent:findFirstChild("Torso") then
  761.         hookBP.Parent = tool.Parent.Torso
  762.         if dist ~= (object.Size.x+object.Size.y+object.Size.z)+5 then
  763.         dist = (object.Size.x+object.Size.y+object.Size.z)+5
  764.         end
  765.         end
  766.         else
  767.         hooked = false
  768.         hookBP.Parent = nil
  769.         end
  770.     end
  771.     if (key=="") then
  772.         if (object==nil) then return end
  773.         color.BrickColor = BrickColor.new("Toothpaste")
  774.         point.BrickColor = BrickColor.new("Toothpaste")
  775.         object.Parent = nil
  776.         wait(.48)
  777.         color.BrickColor = BrickColor.new("Toothpaste")
  778.         point.BrickColor = BrickColor.new("Toothpaste")
  779.     end
  780.     if (key=="") then
  781.     if (object==nil) then return end
  782.     local New = object:clone()
  783.     New.Parent = object.Parent
  784.     for _,v in pairs(New:children()) do
  785.     if v.className == "BodyPosition" or v.className == "BodyGyro" then
  786.     v.Parent = nil
  787.     end
  788.     end
  789.     object = New
  790.     mousedown = false
  791.     mousedown = true
  792.     LineConnect(front,object,workspace)
  793.         while (mousedown==true) do
  794.         if (object.Parent==nil) then break end
  795.         local lv = CFrame.new(front.Position,mouse.Hit.p)
  796.         BP.Parent = object
  797.         BP.position = front.Position+lv.lookVector*dist
  798.         wait()
  799.     end
  800.     BP:remove()
  801.     object = nil
  802.     objval.Value = nil
  803.     end
  804.     if (key=="") then
  805.         local Cube = Instance.new("Part")
  806.         Cube.Locked = true
  807.         Cube.Size = Vector3.new(4,4,4)
  808.         Cube.formFactor = 0
  809.         Cube.TopSurface = 0
  810.         Cube.BottomSurface = 0
  811.         Cube.Name = "WeightedStorageCube"
  812.         Cube.Parent = workspace
  813.         Cube.CFrame = CFrame.new(mouse.Hit.p) + Vector3.new(0,2,0)
  814.         for i = 0,5 do
  815.             local Decal = Instance.new("Decal")
  816.             Decal.Texture = "http://www.roblox.com/asset/?id=2662260"
  817.             Decal.Face = i
  818.             Decal.Name = "WeightedStorageCubeDecal"
  819.             Decal.Parent = Cube
  820.         end
  821.     end
  822.     if (key=="") then
  823.         if dist ~= 15 then
  824.             dist = 15
  825.         end
  826.     end
  827. end
  828.  
  829. function onEquipped(mouse)
  830.     keymouse = mouse
  831.     local char = tool.Parent
  832.     human = char.Humanoid
  833.     human.Changed:connect(function() if (human.Health==0) then mousedown = false BP:remove() point:remove() tool:remove() end end)
  834.     mouse.Button1Down:connect(function() onButton1Down(mouse) end)
  835.     mouse.Button1Up:connect(function() mousedown = false end)
  836.     mouse.KeyDown:connect(function(key) onKeyDown(key,mouse) end)
  837.     mouse.Icon = "rbxasset://textures\\GunCursor.png"
  838. end
  839.  
  840. tool.Equipped:connect(onEquipped)
  841.  
  842. wait()
  843. local check = physics_gun.Part2
  844. local part1 = physics_gun.Part1.Value
  845. local part2 = physics_gun.Part2.Value
  846. local parent = physics_gun.Par.Value
  847. local color = physics_gun.Color
  848. local line = Instance.new("Part")
  849. line.TopSurface = 0
  850. line.BottomSurface = 0
  851. line.Reflectance = .5
  852. line.Name = "Laser"
  853. line.Locked = true
  854. line.CanCollide = false
  855. line.Anchored = true
  856. line.formFactor = 0
  857. line.Size = Vector3.new(1,1,1)
  858. local mesh = Instance.new("BlockMesh")
  859. mesh.Parent = line
  860. while true do
  861.     if (check.Value==nil) then break end
  862.     if (part1==nil or part2==nil or parent==nil) then break end
  863.     if (part1.Parent==nil or part2.Parent==nil) then break end
  864.     if (parent.Parent==nil) then break end
  865.     local lv = CFrame.new(part1.Position,part2.Position)
  866.     local dist = (part1.Position-part2.Position).magnitude
  867.     line.Parent = parent
  868.     line.BrickColor = color.Value.BrickColor
  869.     line.Reflectance = color.Value.Reflectance
  870.     line.Transparency = color.Value.Transparency
  871.     line.CFrame = CFrame.new(part1.Position+lv.lookVector*dist/2)
  872.     line.CFrame = CFrame.new(line.Position,part2.Position)
  873.     mesh.Scale = Vector3.new(.25,.25,dist)
  874.     wait()
  875. end
  876. line:remove()
  877. physics_gun:remove()
  878.  
  879. local prev
  880. local parts = physics_gun:GetChildren()
  881.  
  882. for i = 1,#parts do
  883.         if (parts[i].className == "Part") then
  884.                 if (prev ~= nil)then
  885.                         local weld = Instance.new("Weld")
  886.                         weld.Part0 = prev
  887.                         weld.Part1 = parts[i]
  888.                         weld.C0 = prev.CFrame:inverse()
  889.                         weld.C1 = parts[i].CFrame:inverse()
  890.                         weld.Parent = prev
  891.                 end
  892.                 prev = parts[i]
  893.         end
  894. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement