Advertisement
Surhaykingtr

Pistol

Mar 7th, 2015
335
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.92 KB | None | 0 0
  1. --HopperBin Pistol Gifted by saud20, Regular Script!
  2.  
  3. name = "xxxGhostxxxx"
  4. me = game.Players[name]
  5. char = me.Character
  6. torso = char.Torso
  7.  
  8. if script.Parent.className ~= "HopperBin" then
  9. hop = Instance.new("HopperBin")
  10. hop.Parent = me.Backpack
  11. hop.Name = "Pistol"
  12. script.Parent = hop
  13. end
  14.  
  15. sp = script.Parent
  16.  
  17. hold1 = Instance.new("Part")
  18. hold1.Parent = char
  19. hold1.Shape = "Ball"
  20. hold1.Size = Vector3.new(1,1,1)
  21. hold1.Transparency = 0
  22. m = Instance.new("SpecialMesh")
  23. m.Parent = hold1
  24. m.Scale = Vector3.new(1.3,1.3,1.3)
  25. m.MeshType = "Sphere"
  26.  
  27. hold2 = hold1:clone()
  28. hold2.Parent = char
  29.  
  30. hw1 = Instance.new("Weld")
  31. hw1.Parent = torso
  32. hw1.Part0 = hw1.Parent
  33. hw1.Part1 = hold1
  34. hw1.C1 = CFrame.new(-1.5,-0.5,0)
  35.  
  36. hw2 = Instance.new("Weld")
  37. hw2.Parent = torso
  38. hw2.Part0 = hw2.Parent
  39. hw2.Part1 = hold2
  40. hw2.C1 = CFrame.new(1.5,-0.5,0)
  41.  
  42. rarm = char["Right Arm"]
  43. larm = char["Left Arm"]
  44.  
  45. left = Instance.new("Weld")
  46. left.Parent = hold2
  47. left.Part0 = nil
  48. left.Part1 = nil
  49. left.C1 = CFrame.new(0,0.5,0)
  50.  
  51. right = Instance.new("Weld")
  52. right.Parent = hold1
  53. right.Part0 = nil
  54. right.Part1 = nil
  55. right.C1 = CFrame.new(0,0.5,0)
  56.  
  57. leftorig = CFrame.fromEulerAnglesXYZ(1.57,0,0.7) * CFrame.new(0.5,-0.9,0)
  58. rightorig = CFrame.fromEulerAnglesXYZ(1.57,0,-0.04) * CFrame.new(-0.3,-0.3,0)
  59. gunorig = CFrame.fromEulerAnglesXYZ(0,0,0) * CFrame.new(0,0,0)
  60.  
  61. gunparts = {}
  62.  
  63. gun1 = Instance.new("Part")
  64. gun1.Parent = game.Lighting
  65. gun1.Name = "Handle"
  66. gun1.formFactor = 0
  67. gun1.Size = Vector3.new(1,1,1)
  68. gun1.TopSurface = 0
  69. gun1.BottomSurface = 0
  70. gun1:BreakJoints()
  71. table.insert(gunparts, gun1)
  72. mesh1 = Instance.new("SpecialMesh")
  73. mesh1.Parent = gun1
  74. mesh1.MeshType = "Brick"
  75. mesh1.Scale = Vector3.new(0.4,1.3,0.5)
  76.  
  77. gun2 = gun1:clone()
  78. gun2.Parent = game.Lighting
  79. gun2.Name = "Handle2"
  80. gun2.Size = Vector3.new(1,2,1)
  81. gun2:BreakJoints()
  82. gun2.Mesh:remove()
  83. table.insert(gunparts, gun2)
  84. mesh2 = Instance.new("SpecialMesh")
  85. mesh2.MeshType = "Brick"
  86. mesh2.Parent = gun2
  87. mesh2.Scale = Vector3.new(0.7,0.9,0.7)
  88. gun3 = gun2:clone()
  89. gun3.Parent = game.Lighting
  90. gun3.Name = "Handle3"
  91. gun3:BreakJoints()
  92. gun3.BrickColor = BrickColor.new("Dark grey")
  93. table.insert(gunparts, gun3)
  94. gun3.Mesh.Scale = Vector3.new(0.74,0.8,0.74)
  95. gun4 = gun2:clone()
  96. gun4.Parent = game.Lighting
  97. gun4.Name = "Handle4"
  98. gun4.Size = Vector3.new(1,1,1)
  99. gun4:BreakJoints()
  100. gun4.BrickColor = BrickColor.new("Dark grey")
  101. table.insert(gunparts, gun4)
  102. gun4.Mesh:remove()
  103. mesh4 = Instance.new("CylinderMesh")
  104. mesh4.Scale = Vector3.new(0.34,0.2,0.34)
  105. mesh4.Parent = gun4
  106. gun5 = gun4:clone()
  107. gun5.Parent = game.Lighting
  108. gun5.Name = "Handle5"
  109. gun5:breakJoints()
  110. gun5.BrickColor = BrickColor.new("Really black")
  111. table.insert(gunparts, gun5)
  112. gun5.Mesh.Scale = Vector3.new(0.28,0.05,0.28)
  113.  
  114. coroutine.resume(coroutine.create(function()
  115. while true do
  116. wait()
  117. if run == true then
  118. for i=1, 8 do
  119. wait()
  120. left.C0 = left.C0 * CFrame.fromEulerAnglesXYZ(-0.35,0,0)
  121. right.C0 = right.C0 * CFrame.fromEulerAnglesXYZ(0.35,0,0)
  122. end
  123. for i=1, 8 do
  124. wait()
  125. left.C0 = left.C0 * CFrame.fromEulerAnglesXYZ(0.35,0,0)
  126. right.C0 = right.C0 * CFrame.fromEulerAnglesXYZ(-0.35,0,0)
  127. end
  128. end
  129. end
  130. end))
  131.  
  132. function selected(mouse,key)
  133. char.Humanoid.Running:connect(function(speed)
  134. if speed < 1 then
  135. run = false
  136. left.C0 = leftorig
  137. right.C0 = rightorig
  138. wait(0.4)
  139. left.C0 = leftorig
  140. right.C0 = rightorig
  141. else
  142. run = true
  143. left.C0 = CFrame.fromEulerAnglesXYZ(1,0,0)
  144. right.C0 = CFrame.fromEulerAnglesXYZ(-1,0,0)
  145. end
  146. end)
  147. mouse.Button1Down:connect(function()
  148. local bullet = Instance.new("Part")
  149. bullet.Parent = workspace
  150. bullet.formFactor = 0
  151. bullet.Size = Vector3.new(1,1,1)
  152. bullet.CanCollide = false
  153. bullet.CFrame = CFrame.new(gun5.Position, mouse.Hit.p)
  154. bullet.CFrame = CFrame.new(bullet.Position + (bullet.CFrame.lookVector * 1), mouse.Hit.p)
  155. local m = Instance.new("SpecialMesh")
  156. m.Parent = bullet
  157. m.MeshType = "FileMesh"
  158. m.Scale = Vector3.new(0.45,0.45,0.3)
  159. m.MeshId = "http://www.roblox.com/asset/?id=2697549"
  160. m.TextureId = "http://www.roblox.com/asset/?id=2697544"
  161. local bv = Instance.new("BodyForce")
  162. bv.Parent = bullet
  163. bv.force = bullet.CFrame.lookVector * 6000
  164. bv.force = bv.force + Vector3.new(0,300,0)
  165. local tee = true
  166. bullet:BreakJoints()
  167. coroutine.resume(coroutine.create(function()
  168. while tee == true do
  169. wait()
  170. local op = bullet:clone()
  171. op.Parent = workspace
  172. op.Mesh.TextureId = "Clear"
  173. op.Transparency = 0.3
  174. op.BrickColor = BrickColor.new("New Yeller")
  175. op.Anchored = true
  176. op.Mesh.Scale = Vector3.new(0.4,0.4,3)
  177. coroutine.resume(coroutine.create(function()
  178. for i=1, 10 do
  179. wait()
  180. op.Transparency = op.Transparency + 0.08
  181. end
  182. op:remove()
  183. end))
  184. end
  185. end))
  186. coroutine.resume(coroutine.create(function()
  187. wait(4)
  188. tee = false
  189. bullet:remove()
  190. end))
  191. bullet.Touched:connect(function(hit)
  192. if hit.Parent.Name == name then return end
  193. local hum = hit.Parent:findFirstChild("Humanoid")
  194. if hum ~= nil then
  195. tee = false
  196. bullet:remove()
  197. hum.Health = hum.Health - 35
  198. end
  199. end)
  200. for i=1, 2 do
  201. wait()
  202. left.C0 = left.C0 * CFrame.fromEulerAnglesXYZ(0.1,0,0)
  203. right.C0 = right.C0 * CFrame.fromEulerAnglesXYZ(0.1,0,0)
  204. end
  205. for i=1, 2 do
  206. wait()
  207. left.C0 = left.C0 * CFrame.fromEulerAnglesXYZ(-0.1,0,0)
  208. right.C0 = right.C0 * CFrame.fromEulerAnglesXYZ(-0.1,0,0)
  209. end
  210. end)
  211. left.Part0 = left.Parent
  212. left.Part1 = larm
  213. left.C0 = leftorig
  214. right.Part0 = right.Parent
  215. right.Part1 = rarm
  216. right.C0 = rightorig
  217. gunweld = Instance.new("Weld")
  218. gunweld.Parent = rarm
  219. gunweld.Part0 = gunweld.Parent
  220. gunweld.Part1 = gun1
  221. gunweld.C1 = CFrame.fromEulerAnglesXYZ(1.57,0,0) * CFrame.new(0.3,1.1,0.07)
  222. gunweld.C0 = gunorig
  223. gunweld2 = Instance.new("Weld")
  224. gunweld2.Parent = gun1
  225. gunweld2.Part0 = gunweld2.Parent
  226. gunweld2.Part1 = gun2
  227. gunweld2.C1 = CFrame.fromEulerAnglesXYZ(1.57,0,0) * CFrame.new(0,-0.67,0.5)
  228. gunweld3 = Instance.new("Weld")
  229. gunweld3.Parent = gun1
  230. gunweld3.Part0 = gunweld3.Parent
  231. gunweld3.Part1 = gun3
  232. gunweld3.C1 = CFrame.fromEulerAnglesXYZ(1.57,0,0) * CFrame.new(0,-0.73,0.3)
  233. gunweld4 = Instance.new("Weld")
  234. gunweld4.Parent = gun2
  235. gunweld4.Part0 = gunweld4.Parent
  236. gunweld4.Part1 = gun4
  237. gunweld4.C1 = CFrame.fromEulerAnglesXYZ(0,0,0) * CFrame.new(0,-0.9,0)
  238. gunweld5 = Instance.new("Weld")
  239. gunweld5.Parent = gun4
  240. gunweld5.Part0 = gunweld5.Parent
  241. gunweld5.Part1 = gun5
  242. gunweld5.C1 = CFrame.fromEulerAnglesXYZ(0,0,0) * CFrame.new(0,-0.09,0)
  243. for i=1, #gunparts do
  244. gunparts[i].Parent = char
  245. end
  246. end
  247.  
  248. function deselected()
  249. left.C0 = CFrame.new(0,0,0)
  250. left.Part0 = nil
  251. left.Part1 = nil
  252. right.C0 = CFrame.new(0,0,0)
  253. right.Part0 = nil
  254. right.Part1 = nil
  255. for i=1, #gunparts do
  256. gunparts[i].Parent = game.Lighting
  257. end
  258. end
  259.  
  260. sp.Deselected:connect(deselected)
  261. sp.Selected:connect(selected)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement