Advertisement
KeroroGunso0

Pistol

Jul 13th, 2015
416
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.18 KB | None | 0 0
  1. me = game.Players.KeroroGunso2016
  2. cha = me.Character
  3.  
  4. tool = Instance.new("Tool")
  5. tool.Parent = me.Backpack
  6. tool.Name = "Pistol"
  7. tool.GripPos = Vector3.new(0.3,0,0)
  8.  
  9. we = Instance.new("Weld")
  10. we.Parent = cha.Torso
  11. we.Part0 = nil
  12. we.Part1 = nil
  13. we.C1 = CFrame.fromEulerAnglesXYZ(-1.6,-0.5,0.1) * CFrame.new(-0.8,-0.5,0.7)
  14. we1 = Instance.new("Weld")
  15. we1.Parent = cha.Torso
  16. we1.Part0 = nil
  17. we1.Part1 = nil
  18. we1.C1 = CFrame.fromEulerAnglesXYZ(-1.6,0.7,0.1) * CFrame.new(0.7,-0.5,0.7)
  19.  
  20. h = Instance.new("Part")
  21. h.Parent = tool
  22. h.Name = "Handle"
  23. h.Size = Vector3.new(1,1,1)
  24. h.TopSurface = 0
  25. h.BottomSurface = 0
  26. h.BrickColor = BrickColor.new("Dark grey")
  27. h.Reflectance = 0.07
  28. h.CanCollide = false
  29.  
  30. m = Instance.new("BlockMesh")
  31. m.Parent = h
  32. m.Scale = Vector3.new(0.38, 1.05, 0.48)
  33. m.Name = "oo"
  34.  
  35. h1 = Instance.new("Part")
  36. h1.Parent = tool
  37. h1.Name = "Handle1"
  38. h1.Size = Vector3.new(1,1,1)
  39. h1.TopSurface = 0
  40. h1.BottomSurface = 0
  41. h1.BrickColor = BrickColor.new("Medium stone grey")
  42. h1.Reflectance = 0.07
  43. h1.CanCollide = false
  44.  
  45. m1 = Instance.new("BlockMesh")
  46. m1.Parent = h1
  47. m1.Scale = Vector3.new(0.45, 0.45, 1.8)
  48.  
  49. h2 = Instance.new("Part")
  50. h2.Parent = tool
  51. h2.Name = "Handle2"
  52. h2.Size = Vector3.new(1,1,1)
  53. h2.TopSurface = 0
  54. h2.BottomSurface = 0
  55. h2.BrickColor = BrickColor.new("Dark grey")
  56. h2.Reflectance = 0.04
  57. h2.CanCollide = false
  58.  
  59. m2 = Instance.new("CylinderMesh")
  60. m2.Parent = h2
  61. m2.Scale = Vector3.new(0.13, 0.32, 0.13)
  62.  
  63. h3 = h2:clone()
  64. h3.Parent = tool
  65. h3.Name = "Handle3"
  66.  
  67. h4 = Instance.new("Part")
  68. h4.Parent = tool
  69. h4.Name = "Handle4"
  70. h4.Size = Vector3.new(1,1,1)
  71. h4.TopSurface = 0
  72. h4.BottomSurface = 0
  73. h4.BrickColor = BrickColor.new("Dark grey")
  74. h4.Reflectance = 0.01
  75. h4.CanCollide = false
  76.  
  77. m4 = Instance.new("BlockMesh")
  78. m4.Parent = h4
  79. m4.Scale = Vector3.new(0.1, 0.2, 0.03)
  80.  
  81. h5 = Instance.new("Part")
  82. h5.Parent = tool
  83. h5.Name = "Handle5"
  84. h5.Size = Vector3.new(1,1,1)
  85. h5.TopSurface = 0
  86. h5.BottomSurface = 0
  87. h5.BrickColor = BrickColor.new("Dark grey")
  88. h5.CanCollide = false
  89.  
  90. m5 = Instance.new("BlockMesh")
  91. m5.Parent = h5
  92. m5.Scale = Vector3.new(0.53, 0.36, 1.53)
  93.  
  94. h6 = Instance.new("Part")
  95. h6.Parent = tool
  96. h6.Name = "Handle6"
  97. h6.Size = Vector3.new(1,1,1)
  98. h6.TopSurface = 0
  99. h6.BottomSurface = 0
  100. h6.BrickColor = BrickColor.new("Really black")
  101. h6.CanCollide = false
  102.  
  103. m6 = Instance.new("CylinderMesh")
  104. m6.Parent = h6
  105. m6.Scale = Vector3.new(0.2, 0.2, 0.2)
  106.  
  107. firf = Instance.new("Fire")
  108. firf.Size = 0
  109. firf.Heat = 40
  110. firf.Parent = h6
  111. firf.Enabled = false
  112.  
  113. h7 = Instance.new("Part")
  114. h7.Parent = tool
  115. h7.Name = "Handle7"
  116. h7.Size = Vector3.new(1,1,1)
  117. h7.TopSurface = 0
  118. h7.BottomSurface = 0
  119. h7.BrickColor = BrickColor.new("Medium stone grey")
  120. h7.CanCollide = false
  121.  
  122. m7 = Instance.new("BlockMesh")
  123. m7.Parent = h7
  124. m7.Scale = Vector3.new(0.025, 0.08, 0.05)
  125.  
  126. h8 = h7:clone()
  127. h8.Parent = tool
  128. h8.Name = "Handle8"
  129.  
  130. h9 = h7:clone()
  131. h9.Parent = tool
  132. h9.Name = "Handle9"
  133. h9.CanCollide = false
  134.  
  135. h10 = h:clone()
  136. h10.Parent = tool
  137. h10.Name = "Handle10"
  138. h10.oo.Scale = Vector3.new(0.16, 0.8, 0.34)
  139. h10.BrickColor = BrickColor.new("Medium stone grey")
  140.  
  141. smo = Instance.new("Smoke")
  142. smo.Color = Color3.new(100/255, 100/255, 100/255)
  143. smo.Parent = h7
  144. smo.Size = 0
  145. smo.RiseVelocity = 5
  146. smo.Enabled = false
  147.  
  148. gui = Instance.new("ScreenGui")
  149. gui.Parent = me.PlayerGui
  150. gui.Name = "PistolAmmo"
  151.  
  152. value = Instance.new("NumberValue")
  153. value.Parent = gui
  154. value.Value = 8
  155. value.Name = "ammoo"
  156.  
  157. clips = Instance.new("NumberValue")
  158. clips.Parent = gui
  159. clips.Value = 5
  160. clips.Name = "claps"
  161.  
  162. blaa = Instance.new("Frame")
  163. blaa.Parent = gui
  164. blaa.Size = UDim2.new(0,80,0,40)
  165. blaa.Position = UDim2.new(0,50,0,100)
  166. blaa.Visible = false
  167. blaa.BackgroundColor = BrickColor.new("Really black")
  168. blaa.BorderColor = BrickColor.new("New Yeller")
  169.  
  170. text = Instance.new("TextLabel")
  171. text.Parent = gui
  172. text.Name = "Ammo"
  173. text.Text = value.Value.."/"..clips.Value
  174. text.Size = UDim2.new(0, 80, 0, 0)
  175. text.Position = UDim2.new(0, 50, 0, 125)
  176. text.Visible = false
  177. text.BackgroundTransparency = 1
  178. text.TextColor = BrickColor.new("New Yeller")
  179.  
  180. durp = Instance.new("TextLabel")
  181. durp.Parent = gui
  182. durp.Name = "txt"
  183. durp.Text = " "
  184. durp.Size = UDim2.new(0, 80, 0, 0)
  185. durp.Position = UDim2.new(0, 50, 0, 115)
  186. durp.Visible = false
  187. durp.BackgroundTransparency = 1
  188. durp.TextColor = BrickColor.new("New Yeller")
  189.  
  190. local sound = Instance.new("Sound")
  191. sound.Parent = h1
  192. sound.Volume = 1
  193. sound.Pitch = 1
  194. sound.SoundId = "http://www.roblox.com/asset/?id=2760979"
  195. sound.archivable = false
  196.  
  197. local soun = Instance.new("Sound")
  198. soun.Parent = h1
  199. soun.Volume = 1
  200. soun.Pitch = 1
  201. soun.SoundId = "http://www.roblox.com/asset/?id=2691591"
  202. soun.archivable = false
  203.  
  204. local hed = Instance.new("Sound")
  205. hed.Parent = game.Workspace
  206. hed.Volume = 0.7
  207. hed.Pitch = 1
  208. hed.SoundId = "http://www.roblox.com/asset/?id=1876552"
  209. hed.archivable = false
  210.  
  211. enabled = false
  212.  
  213. function shot()
  214. local p = Instance.new("Part")
  215. p.Parent = game.Workspace
  216. p.Size = Vector3.new(1,1,1)
  217. p.TopSurface = 0
  218. p.BottomSurface = 0
  219. p.CFrame = h1.CFrame * CFrame.new(0,0,0)
  220. p:breakJoints()
  221. p.Anchored = false
  222. p.CanCollide = false
  223. local m = Instance.new("SpecialMesh")
  224. m.Parent = p
  225. m.MeshType = "FileMesh"
  226. m.Scale = Vector3.new(0.35,0.35,0.22)
  227. m.MeshId = "http://www.roblox.com/asset/?id=2697549"
  228. m.TextureId = "http://www.roblox.com/asset/?id=2697544"
  229. local bv = Instance.new("BodyForce")
  230. bv.Parent = p
  231. bv.force = h1.CFrame.lookVector * 2500
  232. bv.force = bv.force + Vector3.new(0, 220, 0)
  233. sound.Pitch = math.random(0.8,1.2)
  234. sound.Volume = math.random(0.8,1.0)
  235. sound:play()
  236. firf.Enabled = true
  237. smo.Enabled = true
  238. wait(0.04)
  239. firf.Enabled = false
  240. smo.Enabled = false
  241. p.Touched:connect(function(hit)
  242. if hit.Parent.Name == me.Name then return end
  243. if hit.Name == "Base" then return end
  244. hit.Velocity = p.CFrame.lookVector * 30
  245. local hum = hit.Parent:GetChildren()
  246. for i=1, #hum do
  247. if hum[i].className == "Humanoid" then
  248. hum[i].Health = hum[i].Health - 20
  249. if hit.Name == "Head" then
  250. hed:play()
  251. hum[i].Health = 0
  252. end
  253. for i=1, math.random(4,10) do
  254. local blood = Instance.new("Part")
  255. blood.Parent = game.Workspace
  256. blood.BrickColor = BrickColor.new(21)
  257. blood.formFactor = "Plate"
  258. blood.Size = Vector3.new(1,0.4,1)
  259. blood.TopSurface = 0
  260. blood.BottomSurface = 0
  261. blood.CFrame = hit.CFrame
  262. blood.Velocity = Vector3.new(math.random(-40,40),math.random(-10,25),math.random(-40,40))
  263. blood.RotVelocity = Vector3.new(math.random(-40,40),math.random(-40,40),math.random(-40,40))
  264. blood.CanCollide = false
  265. blood.Anchored = false
  266. blood:BreakJoints()
  267. end
  268. end
  269. end
  270. p:remove()
  271. end)
  272. end
  273.  
  274. function Main(mouse)
  275. if enabled == true then return end
  276. enabled = true
  277. value.Value = value.Value - 1
  278. text.Text = value.Value.."/"..clips.Value
  279.  
  280. if value.Value == -1 then
  281. durp.Text = "You're out!"
  282. text.Text = "0/"..clips.Value
  283. if clips.Value <= 0 then return end
  284. durp.Text = "Reloading.."
  285. soun:play()
  286. wait(0.5)
  287. local fv = h10:clone()
  288. fv.Parent = workspace
  289. fv.CanCollide = true
  290. fv.Velocity = Vector3.new(math.random(-20,20),math.random(-5,5),math.random(-20,20))
  291. fv.RotVelocity = Vector3.new(math.random(-20,20),math.random(-20,20),math.random(-20,20))
  292. h10.Transparency = 1
  293. wait(1.7)
  294. h10.Transparency = 0
  295. wait(0.5)
  296. clips.Value = clips.Value - 1
  297. value.Value = 8
  298. text.Text = value.Value.."/"..clips.Value
  299. durp.Text = " "
  300. end
  301. shot()
  302.  
  303. for i=1, 2 do
  304. wait()
  305. w2.C1 = w2.C1 * CFrame.fromEulerAnglesXYZ(0.23,0,0) * CFrame.new(0,-0.08,-0.2)
  306. end
  307. for i=1, 2 do
  308. wait()
  309. w2.C1 = w2.C1 * CFrame.fromEulerAnglesXYZ(-0.23,0,0) * CFrame.new(0,0.08,0.2)
  310. end
  311. w2.C1 = CFrame.fromEulerAnglesXYZ(-0.1, 0, 0) * CFrame.new(0,-0.43,0.35)
  312. wait(0.1)
  313. for i = 1, 6 do
  314. w4.C1 = w4.C1 * CFrame.new(0,0,-0.08)
  315. w7.C1 = w7.C1 * CFrame.new(0,0,-0.08)
  316. w8.C1 = w8.C1 * CFrame.new(0,0,-0.08)
  317. wait()
  318. end
  319. for i = 1, 2 do
  320. w4.C1 = w4.C1 * CFrame.new(0,0,0.24)
  321. w7.C1 = w7.C1 * CFrame.new(0,0,0.24)
  322. w8.C1 = w8.C1 * CFrame.new(0,0,0.24)
  323. wait()
  324. end
  325. w5.C1 = CFrame.fromEulerAnglesXYZ(1.571, 0, 0) * CFrame.new(0,-0.8,1.39)
  326. w7.C1 = CFrame.fromEulerAnglesXYZ(0, 0, 0) * CFrame.new(0.03,-1.11,-0.25)
  327. w8.C1 = CFrame.fromEulerAnglesXYZ(0, 0, 0) * CFrame.new(-0.03,-1.11,-0.25)
  328. wait(0.03)
  329. enabled = false
  330. wait(2)
  331. p:remove()
  332. end
  333. tool.Activated:connect(Main)
  334.  
  335. num = 1
  336. function Init(mouse)
  337. text.Visible = true
  338. blaa.Visible = true
  339. durp.Visible = true
  340. we.Part0 = we.Parent
  341. we.Part1 = cha["Right Arm"]
  342. we1.Part0 = we1.Parent
  343. we1.Part1 = cha["Left Arm"]
  344. we2 = Instance.new("Weld")
  345. we2.Parent = tool.Parent.Torso
  346. we2.Part0 = we2.Parent
  347. we2.Part1 = h
  348. we2.C1 = CFrame.fromEulerAnglesXYZ(0,0,0) * CFrame.new(0,-0.5,1.6)
  349. w = Instance.new("Weld")
  350. w.Parent = h
  351. w.Part0 = w.Parent
  352. w.Part1 = h1
  353. w.C1 = CFrame.new(0, -0.8, 0.6)
  354. w1 = Instance.new("Weld")
  355. w1.Parent = h
  356. w1.Part0 = w.Parent
  357. w1.Part1 = h2
  358. w1.C1 = CFrame.fromEulerAnglesXYZ(0.3, 0, 0) * CFrame.new(0,-0.4,0.55)
  359. w3 = Instance.new("Weld")
  360. w3.Parent = h
  361. w3.Part0 = w.Parent
  362. w3.Part1 = h3
  363. w3.C1 = CFrame.fromEulerAnglesXYZ(1.3, 0, 0) * CFrame.new(0,-0.2,0.35)
  364. w2 = Instance.new("Weld")
  365. w2.Parent = h
  366. w2.Part0 = w.Parent
  367. w2.Part1 = h4
  368. w2.C1 = CFrame.fromEulerAnglesXYZ(-0.1, 0, 0) * CFrame.new(0,-0.43,0.35)
  369. w4 = Instance.new("Weld")
  370. w4.Parent = h
  371. w4.Part0 = w.Parent
  372. w4.Part1 = h5
  373. w4.C1 = CFrame.fromEulerAnglesXYZ(0, 0, 0) * CFrame.new(0,-0.9,0.435)
  374. w5 = Instance.new("Weld")
  375. w5.Parent = h
  376. w5.Part0 = w.Parent
  377. w5.Part1 = h6
  378. w5.C1 = CFrame.fromEulerAnglesXYZ(1.571, 0, 0) * CFrame.new(0,-0.8,1.39)
  379. w6 = Instance.new("Weld")
  380. w6.Parent = h
  381. w6.Part0 = w.Parent
  382. w6.Part1 = h7
  383. w6.C1 = CFrame.fromEulerAnglesXYZ(0, 0, 0) * CFrame.new(0,-1.1,1.4)
  384. w7 = Instance.new("Weld")
  385. w7.Parent = h5
  386. w7.Part0 = w.Parent
  387. w7.Part1 = h8
  388. w7.C1 = CFrame.fromEulerAnglesXYZ(0, 0, 0) * CFrame.new(0.03,-1.11,-0.25)
  389. w8 = Instance.new("Weld")
  390. w8.Parent = h5
  391. w8.Part0 = w.Parent
  392. w8.Part1 = h9
  393. w8.C1 = CFrame.fromEulerAnglesXYZ(0, 0, 0) * CFrame.new(-0.03,-1.11,-0.25)
  394. w9 = Instance.new("Weld")
  395. w9.Parent = h
  396. w9.Part0 = w.Parent
  397. w9.Part1 = h10
  398. w9.C1 = CFrame.fromEulerAnglesXYZ(0, 0, 0) * CFrame.new(0,0.2,0)
  399. end
  400.  
  401. tool.Equipped:connect(Init)
  402.  
  403. function unq()
  404. we.Part0 = nil
  405. we.Part1 = nil
  406. we1.Part0 = nil
  407. we1.Part1 = nil
  408. we2:remove()
  409. text.Visible = false
  410. durp.Visible = false
  411. blaa.Visible = false
  412. end
  413.  
  414. tool.Unequipped:connect(unq)
  415.  
  416.  
  417. --lego
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement