Advertisement
quoc9x

Untitled

Oct 13th, 2016
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.67 KB | None | 0 0
  1. -------------------------------------------------Define Variables
  2. hold=nil --used to notify the loop
  3. player=game.Players.LocalPlayer
  4. run=game:GetService("RunService")
  5. colors = {"Bright orange","Dark stone grey","Bright red"}
  6. chat=game:GetService("Chat")
  7. enabled=true
  8. ---------------------------------------------------KeyDownFunction
  9.  
  10. function onButtonDown(mouse)
  11. if not enabled then return end
  12. enabled=false
  13. if player.PlayerGui.HealthGui.Mana.Value < 30 then
  14. return end
  15. hold=true
  16. ---CFrame Variables
  17. LeftShoulder=player.Character.Torso["Left Shoulder"]
  18. RightShoulder=player.Character.Torso["Right Shoulder"]
  19. value1 = LeftShoulder.C0
  20. value2 = RightShoulder.C0
  21. Run = game:GetService("RunService")
  22. ---CFrame Variables End
  23. bodypos = Instance.new("BodyPosition",player.Character.Torso)
  24. bodypos.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  25. bodypos.Position = player.Character.Torso.Position
  26. player.Character.Humanoid.JumpPower = 0
  27. ------Create Fire Effect
  28. f = script.Sphere:clone()
  29. f.Parent = player.Character.Torso
  30. f.CFrame = player.Character:FindFirstChild("Torso").CFrame*CFrame.new(0,-3,0)
  31. w = Instance.new("ManualWeld",player.Character:FindFirstChild("Torso"))
  32. w.Part0 = player.Character:FindFirstChild("Torso")
  33. w.Part1 = f
  34. f2 = script.Sphere2:clone()
  35. f2.Parent = player.Character.Torso
  36. f2.CFrame = player.Character:FindFirstChild("Torso").CFrame*CFrame.new(0,-3,0)
  37. w = Instance.new("ManualWeld",player.Character:FindFirstChild("Torso"))
  38. w.Part0 = player.Character:FindFirstChild("Torso")
  39. w.Part1 = f2
  40. for i=1,20 do
  41. f.Transparency = f.Transparency - 0.025
  42. f2.Transparency = f2.Transparency - 0.025
  43. f.Mesh.Scale = f.Mesh.Scale + Vector3.new(0.2,0.2,0.2)
  44. f2.Mesh.Scale = f2.Mesh.Scale + Vector3.new(0.2,0.2,0.2)
  45. wait()
  46. end
  47. ------Fire Effect End
  48. RightShoulder.C0 = RightShoulder.C0 *CFrame.Angles(-0.5, 0, -1.5)
  49. LeftShoulder.C0 = LeftShoulder.C0 *CFrame.Angles(-0.5, 0, 1.5)
  50. player.PlayerGui.HealthGui.Mana.Value = player.PlayerGui.HealthGui.Mana.Value - 30
  51. charge()
  52. end
  53.  
  54. -----------------------Charge Function
  55.  
  56.  
  57.  
  58. function charge()
  59. local range = 20
  60. local count = 2
  61. local damage=(35+(player.leaderstats1.Level.Value*0.1))
  62. local mouse = player:GetMouse()
  63. while hold==true and range<=100 and player.PlayerGui.HealthGui.Mana.Value > 0 do---Charging
  64. wait(0.001)
  65. player.PlayerGui.HealthGui.Mana.Value = player.PlayerGui.HealthGui.Mana.Value - 5
  66. damage=damage+1
  67. range=range+1
  68. count=count+0.5
  69. f.Mesh.Scale = f.Mesh.Scale + Vector3.new(0.1,0.1,0.1)
  70. f2.Mesh.Scale = f2.Mesh.Scale + Vector3.new(0.1,0.1,0.1)
  71. end
  72. wait()
  73. RightShoulder.C0 = value2
  74. LeftShoulder.C0 = value1
  75. RightShoulder.C0 = RightShoulder.C0 *CFrame.Angles(-0.5, 0, 1.5)
  76. LeftShoulder.C0 = LeftShoulder.C0 *CFrame.Angles(-0.5, 0, -1.5)
  77. chat:Chat(player.Character.Head,"Sand Turret!",Enum.ChatColor.Red)
  78. player.leaderstats1.XP.Value = player.leaderstats1.XP.Value + 25
  79. HP = player.Character.Humanoid.Health
  80. for i=1,count do
  81. player.Character.Humanoid.Health = player.Character.Humanoid.MaxHealth
  82. local Search = game.Workspace:GetChildren()
  83. for i = 1, #Search do
  84. if Search[i]:findFirstChild("Humanoid") and Search[i].Humanoid.Health ~= 0 and Search[i] ~= player.Character and Search[i]:findFirstChild("Torso") then
  85. if (Search[i].Torso.Position - player.Character.Torso.Position).magnitude <= range then
  86. player.Character.Humanoid.Health = player.Character.Humanoid.MaxHealth
  87. local Position = math.random(1, 8)
  88. if Position == 1 then
  89. player.Character.Torso.CFrame = Search[i].Torso.CFrame * CFrame.new(3, 0, 0)
  90. elseif Position == 2 then
  91. player.Character.Torso.CFrame = Search[i].Torso.CFrame * CFrame.new(-3, 0, 0)
  92. elseif Position == 3 then
  93. player.Character.Torso.CFrame = Search[i].Torso.CFrame * CFrame.new(0, 0, 3)
  94. elseif Position == 4 then
  95. player.Character.Torso.CFrame = Search[i].Torso.CFrame * CFrame.new(0, 0, -3)
  96. elseif Position == 5 then
  97. player.Character.Torso.CFrame = Search[i].Torso.CFrame * CFrame.new(3, 0, 3)
  98. elseif Position == 6 then
  99. player.Character.Torso.CFrame = Search[i].Torso.CFrame * CFrame.new(-3, 0, -3)
  100. elseif Position == 7 then
  101. player.Character.Torso.CFrame = Search[i].Torso.CFrame * CFrame.new(-3, 0, 3)
  102. elseif Position == 8 then
  103. player.Character.Torso.CFrame = Search[i].Torso.CFrame * CFrame.new(3, 0, -3)
  104. end
  105. local debounce = Instance.new("BoolValue", Search[i])
  106. debounce.Name = "struck"
  107. game.Debris:AddItem(debounce, 1)
  108. lastpos = player.Character.Torso.Position
  109. Search[i].Humanoid:TakeDamage(damage)
  110. d = game.Lighting.DamagePart:clone()
  111. d.Parent = workspace
  112. d.DamageGui.Damage.Text = damage
  113. d.Position = Search[i].Torso.Position
  114. d.Move.Disabled = false
  115. game.Debris:AddItem(d,7)
  116. local SFX = Instance.new("Sound", player.Character.Torso)
  117. SFX.SoundId = "rbxassetid://260430117"
  118. SFX.Volume = 2
  119. SFX:Play()
  120. local SFX = Instance.new("Sound", player.Character.Torso)
  121. SFX.SoundId = "rbxassetid://153613030"
  122. SFX.Volume = 2
  123. SFX:Play()
  124. player.Character.Humanoid.Health = player.Character.Humanoid.MaxHealth
  125. wait(0.1)
  126. end
  127. end
  128. end
  129. end
  130.  
  131. wait()
  132. f:remove()
  133. f2:remove()
  134. player.Character.Humanoid.Health = HP
  135. bodypos:remove()
  136. player.Character.Humanoid.JumpPower = 50
  137. RightShoulder.C0 = value2
  138. LeftShoulder.C0 = value1
  139. wait(5)
  140. enabled=true
  141. end
  142. -----------------------------------------------ButtonUpfunction
  143. function onButtonUp(mouse)
  144. hold=false
  145. end
  146.  
  147.  
  148. function onSelected(mouse)
  149. mouse.Button1Down:connect(function()onButtonDown(mouse)end)
  150. mouse.Button1Up:connect(function()onButtonUp(mouse)end)
  151. end
  152. script.Parent.Selected:connect(onSelected)
  153. ------------------------------------------------------End
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement