0_Abysal

Galick gun!!

Jul 28th, 2018
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.64 KB | None | 0 0
  1. ModelName = "Galick gun"
  2.  
  3. MainColor = BrickColor.new("Bright violet")
  4.  
  5. SecondaryColor = BrickColor.new("Bright violet")
  6.  
  7. function CreatePart(Part,Color,Size,Name,Parent)
  8.  
  9. Part.BrickColor = Color
  10.  
  11. Part.FormFactor = "Custom"
  12.  
  13. Part.Size = Size
  14.  
  15. Part.CanCollide = false
  16.  
  17. Part.TopSurface = 0
  18.  
  19. Part.BottomSurface = 0
  20.  
  21. Part.CFrame = CFrame.new(0,10,0)
  22.  
  23. Part.Name = Name
  24.  
  25. Part.Parent = Parent
  26.  
  27. end
  28.  
  29. function Cylinder(Scale,Parent)
  30.  
  31. Mesh = Instance.new("CylinderMesh")
  32.  
  33. Mesh.Scale = Scale
  34.  
  35. Mesh.Parent = Parent
  36.  
  37. end
  38.  
  39. function Sphere(Scale,Parent)
  40.  
  41. Mesh = Instance.new("SpecialMesh")
  42.  
  43. Mesh.MeshType = "Sphere"
  44.  
  45. Mesh.Scale = Scale
  46.  
  47. Mesh.Parent = Parent
  48.  
  49. end
  50.  
  51. function Glue(Part0,Part1,C0)
  52.  
  53. Weld = Instance.new("Weld")
  54.  
  55. Weld.Part0 = Part0
  56.  
  57. Weld.Part1 = Part1
  58.  
  59. Weld.C0 = C0
  60.  
  61. Weld.Parent = Part1
  62.  
  63. end
  64.  
  65. Player = game.Players.yfc
  66.  
  67. Char = Player.Character
  68.  
  69. for i, v in pairs(Char:GetChildren()) do
  70.  
  71. if v.Name == ModelName then
  72.  
  73. v:remove()
  74.  
  75. end
  76.  
  77. end
  78.  
  79. Humanoid = Char.Humanoid
  80.  
  81. Head = Char.Head
  82.  
  83. Torso = Char.Torso
  84.  
  85. RightArm = Char["Right Arm"]
  86.  
  87. LeftArm = Char["Left Arm"]
  88.  
  89. RightLeg = Char["Right Leg"]
  90.  
  91. LeftLeg = Char["Left Leg"]
  92.  
  93. Neck = Instance.new("Weld")
  94.  
  95. Neck.Part0 = Torso
  96.  
  97. Neck.Part1 = Head
  98.  
  99. Neck.C0 = CFrame.new(0,1.5,0)
  100.  
  101. Neck.Parent = Torso
  102.  
  103. RightShoulder = Torso["Right Shoulder"]
  104.  
  105. LeftShoulder = Torso["Left Shoulder"]
  106.  
  107. RightHip = Torso["Right Hip"]
  108.  
  109. LeftHip = Torso["Left Hip"]
  110.  
  111. Weapon = Instance.new("Model")
  112.  
  113. Weapon.Name = ModelName
  114.  
  115. Weapon.Parent = Char
  116.  
  117. Spot = Instance.new("Part")
  118.  
  119. Backpack = Player.Backpack
  120.  
  121. for i, v in pairs(Backpack:GetChildren()) do
  122.  
  123. if v.Name == ModelName then
  124.  
  125. v:remove()
  126.  
  127. end
  128.  
  129. end
  130.  
  131. HopperBin = Instance.new("HopperBin")
  132.  
  133. HopperBin.Name = ModelName
  134.  
  135. HopperBin.Parent = Backpack
  136.  
  137. Damage = Instance.new("IntValue")
  138.  
  139. Damage.Value = 15
  140.  
  141. Damage.Name = "Damage"
  142.  
  143. Damage.Parent = HopperBin
  144.  
  145. script.Parent = HopperBin
  146.  
  147. PlayerGui = Player.PlayerGui
  148.  
  149. for i, v in pairs(PlayerGui:GetChildren()) do
  150.  
  151. if v.Name == "Gui" then
  152.  
  153. v:remove()
  154.  
  155. end
  156.  
  157. end
  158.  
  159. Gui = Instance.new("ScreenGui")
  160.  
  161. Gui.Name = "Gui"
  162.  
  163. Gui.Parent = PlayerGui
  164.  
  165. MaxEnergy = Instance.new("IntValue")
  166.  
  167. MaxEnergy.Value = 100
  168.  
  169. MaxEnergy.Name = "MaxEnergy"
  170.  
  171. MaxEnergy.Parent = Gui
  172.  
  173. Energy = Instance.new("IntValue")
  174.  
  175. Energy.Value = 0
  176.  
  177. Energy.Name = "Energy"
  178.  
  179. Energy.Parent = Gui
  180.  
  181. Bar = Instance.new("Frame")
  182.  
  183. Bar.BackgroundColor = BrickColor.new(Color3.new(1,1,1))
  184.  
  185. Bar.Size = UDim2.new(0.25,0,0.02,0)
  186.  
  187. Bar.Position = UDim2.new(0.05,0,0.5,0)
  188.  
  189. Bar.Name = "Bar"
  190.  
  191. Bar.Parent = Gui
  192.  
  193. BarTracking = Instance.new("Frame")
  194.  
  195. BarTracking.BackgroundColor = BrickColor.new(Color3.new(0,153,204))
  196.  
  197. BarTracking.Name = "BarTracking"
  198.  
  199. BarTracking.Parent = Bar
  200.  
  201. Attack = false
  202.  
  203. Hold = false
  204.  
  205. Damaging = false
  206.  
  207. function onButton1Down()
  208.  
  209. if Attack == false then
  210.  
  211. Attack = true
  212.  
  213. Damaging = false
  214.  
  215. Damage.Value = 15
  216.  
  217. Energy.Value = 0
  218.  
  219. Hold = true
  220.  
  221. Bp = Instance.new("BodyPosition")
  222.  
  223. Bp.maxForce = Vector3.new(math.huge,math.huge,math.huge)
  224.  
  225. Bp.position = Torso.Position
  226.  
  227. Bp.Parent = Torso
  228.  
  229. game.Debris:AddItem(Bp,2)
  230.  
  231. Bg = Instance.new("BodyGyro")
  232.  
  233. Bg.maxTorque = Vector3.new(math.huge,math.huge,math.huge)
  234.  
  235. Bg.cframe = Torso.CFrame
  236.  
  237. Bg.Parent = Torso
  238.  
  239. game.Debris:AddItem(Bg,2)
  240.  
  241. for i=1, 4 do
  242.  
  243. wait(0.0001)
  244.  
  245. Neck.C0 = Neck.C0 * CFrame.Angles(0,math.rad(-10),0)
  246.  
  247. end
  248.  
  249. for i=1, 16 do
  250.  
  251. wait(0.0001)
  252.  
  253. RightShoulder.C0 = CFrame.new(1,0.5,0) * CFrame.Angles(0,math.pi/3,math.rad(i*5))
  254.  
  255. LeftShoulder.C0 = CFrame.new(-0,0.5,0) * CFrame.Angles(0,math.pi/-1.5,math.rad(-i*5))
  256.  
  257. end
  258.  
  259. Ball = Instance.new("Part")
  260.  
  261. CreatePart(Ball,SecondaryColor,Vector3.new(1,1,1),"Ball",Weapon)
  262.  
  263. Ball.Transparency = 0.4
  264.  
  265. Ball.CanCollide = false
  266.  
  267. Sphere(Vector3.new(0.01,0.01,0.01),Ball)
  268.  
  269. Glue(Torso,Ball,CFrame.new(1.5,0,-1))
  270.  
  271. Ball2 = Instance.new("Part")
  272.  
  273. CreatePart(Ball2,MainColor,Vector3.new(2.4,2.4,2.4),"Ball",Weapon)
  274.  
  275. Ball2.Transparency = 0.4
  276.  
  277. Ball2.CanCollide = false
  278.  
  279. Sphere(Vector3.new(0.01,0.01,0.01),Ball2)
  280.  
  281. Glue(Torso,Ball2,CFrame.new(1.5,0,-1))
  282.  
  283. for i=1, 20 do
  284.  
  285. wait(0.0001)
  286.  
  287. if Hold == true then
  288.  
  289. Damage.Value = Damage.Value + 1
  290.  
  291. Ball.Mesh.Scale = Ball.Mesh.Scale + Vector3.new(0.01,0.01,0.01)
  292.  
  293. Ball2.Mesh.Scale = Ball2.Mesh.Scale + Vector3.new(0.01,0.01,0.01)
  294.  
  295. else
  296.  
  297. end
  298.  
  299. end
  300.  
  301. game:GetService("Chat"):Chat(Head,"...",1)
  302.  
  303. for i=1, 20 do
  304.  
  305. wait(0.0001)
  306.  
  307. if Hold == true then
  308.  
  309. Damage.Value = Damage.Value + 1
  310.  
  311. Ball.Mesh.Scale = Ball.Mesh.Scale + Vector3.new(0.01,0.01,0.01)
  312.  
  313. Ball2.Mesh.Scale = Ball2.Mesh.Scale + Vector3.new(0.01,0.01,0.01)
  314.  
  315. else
  316.  
  317. end
  318.  
  319. end
  320.  
  321. game:GetService("Chat"):Chat(Head,"Me...",1)
  322.  
  323. for i=1, 20 do
  324.  
  325. wait(0.0001)
  326.  
  327. if Hold == true then
  328.  
  329. Damage.Value = Damage.Value + 1
  330.  
  331. Ball.Mesh.Scale = Ball.Mesh.Scale + Vector3.new(0.01,0.01,0.01)
  332.  
  333. Ball2.Mesh.Scale = Ball2.Mesh.Scale + Vector3.new(0.01,0.01,0.01)
  334.  
  335. else
  336.  
  337. end
  338.  
  339. end
  340.  
  341. game:GetService("Chat"):Chat(Head,"HA...",1)
  342.  
  343. for i=1, 20 do
  344.  
  345. wait(0.0001)
  346.  
  347. if Hold == true then
  348.  
  349. Damage.Value = Damage.Value + 1
  350.  
  351. Ball.Mesh.Scale = Ball.Mesh.Scale + Vector3.new(0.01,0.01,0.01)
  352.  
  353. Ball2.Mesh.Scale = Ball2.Mesh.Scale + Vector3.new(0.01,0.01,0.01)
  354.  
  355. Ball.Reflectance = math.random(0,0.4)
  356.  
  357. Ball2.Reflectance = math.random(0,0.6)
  358.  
  359. else
  360.  
  361. end
  362.  
  363. end
  364.  
  365. game:GetService("Chat"):Chat(Head,"MEE...",1)
  366.  
  367. for i=1, 20 do
  368.  
  369. wait(0.0001)
  370.  
  371. if Hold == true then
  372.  
  373. Damage.Value = Damage.Value + 1
  374.  
  375. Ball.Mesh.Scale = Ball.Mesh.Scale + Vector3.new(0.01,0.01,0.01)
  376.  
  377. Ball2.Mesh.Scale = Ball2.Mesh.Scale + Vector3.new(0.01,0.01,0.01)
  378.  
  379. else
  380.  
  381. end
  382.  
  383. end
  384.  
  385. game:GetService("Chat"):Chat(Head,"HAAAA!!!",1)
  386.  
  387. for i=1, 4 do
  388.  
  389. wait(0.0001)
  390.  
  391. Neck.C0 = Neck.C0 * CFrame.Angles(0,math.rad(10),0)
  392.  
  393. end
  394.  
  395. Ball.Weld.C0 = CFrame.new(0,0,-2)
  396.  
  397. Ball2.Weld.C0 = CFrame.new(0,0,-2)
  398.  
  399. for i=1, 16 do
  400.  
  401. wait(0.0001)
  402.  
  403. RightShoulder.C0 = CFrame.new(1,0.5,0) * CFrame.Angles(0,math.pi/1.5,math.rad(i*5))
  404.  
  405. LeftShoulder.C0 = CFrame.new(-1,0.5,0) * CFrame.Angles(0,math.pi/-1.5,math.rad(-i*5))
  406.  
  407. end
  408.  
  409. if Hold == true then
  410.  
  411. Blast = Instance.new("Part")
  412.  
  413. CreatePart(Blast,MainColor,Vector3.new(3,3,3),"Blast",Weapon)
  414.  
  415. Blast.Transparency = 0.4
  416.  
  417. Blast.CFrame = Torso.CFrame * CFrame.new(0,0,-2)
  418.  
  419. Sphere(Vector3.new(1,1,1),Blast)
  420.  
  421. Spot.CFrame = Torso.CFrame * CFrame.new(0,0,-400)
  422.  
  423. Bp2 = Instance.new("BodyPosition")
  424.  
  425. Bp2.maxForce = Vector3.new(math.huge,math.huge,math.huge)
  426.  
  427. Bp2.position = Spot.Position
  428.  
  429. Bp2.Parent = Blast
  430.  
  431. game.Debris:AddItem(Blast,1)
  432.  
  433. function onTouched(hit)
  434.  
  435. Blast.Anchored = true
  436.  
  437. Blast.Mesh.Scale = Blast.Mesh.Scale + Vector3.new(1,0.5,1)
  438.  
  439. end
  440.  
  441. Blast.Touched:connect(onTouched)
  442.  
  443. function onTouched(hit)
  444.  
  445. Human = hit.Parent:FindFirstChild("Humanoid")
  446.  
  447. if Human ~= nil and Damaging == false and hit.Parent.Name ~= Player.Name then
  448.  
  449. Damaging = true
  450.  
  451. Human:TakeDamage(Damage.Value)
  452.  
  453. end
  454.  
  455. end
  456.  
  457. Blast.Touched:connect(onTouched)
  458.  
  459. for i=1, 20 do
  460.  
  461. OldPos = Blast.Position
  462.  
  463. wait(0.05)
  464.  
  465. NewPos = Blast.Position
  466.  
  467. Dist = (OldPos - NewPos).magnitude
  468.  
  469. Line = Instance.new("Part")
  470.  
  471. CreatePart(Line,MainColor,Vector3.new(3,Dist,3),"Line",Weapon)
  472.  
  473. Line.Transparency = 0.4
  474.  
  475. Line.CanCollide = true
  476.  
  477. Line.Anchored = true
  478.  
  479. Line.CFrame = CFrame.new(OldPos,NewPos) * CFrame.new(0,0,-Dist/2) * CFrame.Angles(math.rad(90),0,0)
  480.  
  481. Cylinder(Vector3.new(1,1,1),Line)
  482.  
  483. game.Debris:AddItem(Line,1)
  484.  
  485. function onTouched(hit)
  486.  
  487. Human = hit.Parent:FindFirstChild("Humanoid")
  488.  
  489. if Human ~= nil and Damaging == false and hit.Parent.Name ~= Player.Name then
  490.  
  491. Damaging = true
  492.  
  493. Human:TakeDamage(Damage.Value)
  494.  
  495. end
  496.  
  497. end
  498.  
  499. Line.Touched:connect(onTouched)
  500.  
  501. end
  502.  
  503. for i, v in pairs(Weapon:GetChildren()) do
  504.  
  505. v:remove()
  506.  
  507. end
  508.  
  509. end
  510.  
  511. for i, v in pairs(Weapon:GetChildren()) do
  512.  
  513. v:remove()
  514.  
  515. end
  516.  
  517. RightShoulder.C0 = CFrame.new(1,0.5,0) * CFrame.Angles(0,math.pi/2,0)
  518.  
  519. LeftShoulder.C0 = CFrame.new(-1,0.5,0) * CFrame.Angles(0,math.pi/-2,0)
  520.  
  521. Attack = false
  522.  
  523. end
  524.  
  525. end
  526.  
  527. function onButton1Up()
  528.  
  529. Hold = false
  530.  
  531. end
  532.  
  533. function onSelected(mouse)
  534.  
  535. mouse.Button1Down:connect(onButton1Down)
  536.  
  537. mouse.Button1Up:connect(onButton1Up)
  538.  
  539. end
  540.  
  541. script.Parent.Selected:connect(onSelected)
  542.  
  543. Spawn(function()
  544.  
  545. while true do
  546.  
  547. wait()
  548.  
  549. BarTracking.Size = UDim2.new(Energy.Value/MaxEnergy.Value,0,1,0)
  550.  
  551. end
  552.  
  553. end)
  554.  
  555. Spawn(function()
  556.  
  557. while true do
  558.  
  559. wait()
  560.  
  561. if Hold == true then
  562.  
  563. Energy.Value = Energy.Value + 1
  564.  
  565. end
  566.  
  567. end
  568.  
  569. end)
  570.  
  571. Spawn(function()
  572.  
  573. while true do
  574.  
  575. wait()
  576.  
  577. if Energy.Value >= MaxEnergy.Value then
  578.  
  579. Energy.Value = MaxEnergy.Value
  580.  
  581. end
  582.  
  583. end
  584.  
  585. end)
  586.  
  587. Spawn(function()
  588.  
  589. while true do
  590.  
  591. wait()
  592.  
  593. if Attack == true then
  594.  
  595. RightShoulder.DesiredAngle = 0
  596.  
  597. LeftShoulder.DesiredAngle = 0
  598.  
  599. end
  600.  
  601. end
  602.  
  603. end)
Add Comment
Please, Sign In to add comment