Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -------------------------------------------------Define Variables
- hold=nil --used to notify the loop
- player=game.Players.LocalPlayer
- run=game:GetService("RunService")
- colors = {"Bright orange","Dark stone grey","Bright red"}
- chat=game:GetService("Chat")
- enabled=true
- ---------------------------------------------------KeyDownFunction
- function onButtonDown(mouse)
- if not enabled then return end
- enabled=false
- if player.PlayerGui.HealthGui.Mana.Value < 30 then
- return end
- hold=true
- ---CFrame Variables
- LeftShoulder=player.Character.Torso["Left Shoulder"]
- RightShoulder=player.Character.Torso["Right Shoulder"]
- value1 = LeftShoulder.C0
- value2 = RightShoulder.C0
- Run = game:GetService("RunService")
- ---CFrame Variables End
- bodypos = Instance.new("BodyPosition",player.Character.Torso)
- bodypos.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
- bodypos.Position = player.Character.Torso.Position
- player.Character.Humanoid.JumpPower = 0
- ------Create Fire Effect
- f = script.Sphere:clone()
- f.Parent = player.Character.Torso
- f.CFrame = player.Character:FindFirstChild("Torso").CFrame*CFrame.new(0,-3,0)
- w = Instance.new("ManualWeld",player.Character:FindFirstChild("Torso"))
- w.Part0 = player.Character:FindFirstChild("Torso")
- w.Part1 = f
- f2 = script.Sphere2:clone()
- f2.Parent = player.Character.Torso
- f2.CFrame = player.Character:FindFirstChild("Torso").CFrame*CFrame.new(0,-3,0)
- w = Instance.new("ManualWeld",player.Character:FindFirstChild("Torso"))
- w.Part0 = player.Character:FindFirstChild("Torso")
- w.Part1 = f2
- for i=1,20 do
- f.Transparency = f.Transparency - 0.025
- f2.Transparency = f2.Transparency - 0.025
- f.Mesh.Scale = f.Mesh.Scale + Vector3.new(0.2,0.2,0.2)
- f2.Mesh.Scale = f2.Mesh.Scale + Vector3.new(0.2,0.2,0.2)
- wait()
- end
- ------Fire Effect End
- RightShoulder.C0 = RightShoulder.C0 *CFrame.Angles(-0.5, 0, -1.5)
- LeftShoulder.C0 = LeftShoulder.C0 *CFrame.Angles(-0.5, 0, 1.5)
- player.PlayerGui.HealthGui.Mana.Value = player.PlayerGui.HealthGui.Mana.Value - 30
- charge()
- end
- -----------------------Charge Function
- function charge()
- local range = 20
- local count = 2
- local damage=(35+(player.leaderstats1.Level.Value*0.1))
- local mouse = player:GetMouse()
- while hold==true and range<=100 and player.PlayerGui.HealthGui.Mana.Value > 0 do---Charging
- wait(0.001)
- player.PlayerGui.HealthGui.Mana.Value = player.PlayerGui.HealthGui.Mana.Value - 5
- damage=damage+1
- range=range+1
- count=count+0.5
- f.Mesh.Scale = f.Mesh.Scale + Vector3.new(0.1,0.1,0.1)
- f2.Mesh.Scale = f2.Mesh.Scale + Vector3.new(0.1,0.1,0.1)
- end
- wait()
- RightShoulder.C0 = value2
- LeftShoulder.C0 = value1
- RightShoulder.C0 = RightShoulder.C0 *CFrame.Angles(-0.5, 0, 1.5)
- LeftShoulder.C0 = LeftShoulder.C0 *CFrame.Angles(-0.5, 0, -1.5)
- chat:Chat(player.Character.Head,"Sand Turret!",Enum.ChatColor.Red)
- player.leaderstats1.XP.Value = player.leaderstats1.XP.Value + 25
- HP = player.Character.Humanoid.Health
- for i=1,count do
- player.Character.Humanoid.Health = player.Character.Humanoid.MaxHealth
- local Search = game.Workspace:GetChildren()
- for i = 1, #Search do
- if Search[i]:findFirstChild("Humanoid") and Search[i].Humanoid.Health ~= 0 and Search[i] ~= player.Character and Search[i]:findFirstChild("Torso") then
- if (Search[i].Torso.Position - player.Character.Torso.Position).magnitude <= range then
- player.Character.Humanoid.Health = player.Character.Humanoid.MaxHealth
- local Position = math.random(1, 8)
- if Position == 1 then
- player.Character.Torso.CFrame = Search[i].Torso.CFrame * CFrame.new(3, 0, 0)
- elseif Position == 2 then
- player.Character.Torso.CFrame = Search[i].Torso.CFrame * CFrame.new(-3, 0, 0)
- elseif Position == 3 then
- player.Character.Torso.CFrame = Search[i].Torso.CFrame * CFrame.new(0, 0, 3)
- elseif Position == 4 then
- player.Character.Torso.CFrame = Search[i].Torso.CFrame * CFrame.new(0, 0, -3)
- elseif Position == 5 then
- player.Character.Torso.CFrame = Search[i].Torso.CFrame * CFrame.new(3, 0, 3)
- elseif Position == 6 then
- player.Character.Torso.CFrame = Search[i].Torso.CFrame * CFrame.new(-3, 0, -3)
- elseif Position == 7 then
- player.Character.Torso.CFrame = Search[i].Torso.CFrame * CFrame.new(-3, 0, 3)
- elseif Position == 8 then
- player.Character.Torso.CFrame = Search[i].Torso.CFrame * CFrame.new(3, 0, -3)
- end
- local debounce = Instance.new("BoolValue", Search[i])
- debounce.Name = "struck"
- game.Debris:AddItem(debounce, 1)
- lastpos = player.Character.Torso.Position
- Search[i].Humanoid:TakeDamage(damage)
- d = game.Lighting.DamagePart:clone()
- d.Parent = workspace
- d.DamageGui.Damage.Text = damage
- d.Position = Search[i].Torso.Position
- d.Move.Disabled = false
- game.Debris:AddItem(d,7)
- local SFX = Instance.new("Sound", player.Character.Torso)
- SFX.SoundId = "rbxassetid://260430117"
- SFX.Volume = 2
- SFX:Play()
- local SFX = Instance.new("Sound", player.Character.Torso)
- SFX.SoundId = "rbxassetid://153613030"
- SFX.Volume = 2
- SFX:Play()
- player.Character.Humanoid.Health = player.Character.Humanoid.MaxHealth
- wait(0.1)
- end
- end
- end
- end
- wait()
- f:remove()
- f2:remove()
- player.Character.Humanoid.Health = HP
- bodypos:remove()
- player.Character.Humanoid.JumpPower = 50
- RightShoulder.C0 = value2
- LeftShoulder.C0 = value1
- wait(5)
- enabled=true
- end
- -----------------------------------------------ButtonUpfunction
- function onButtonUp(mouse)
- hold=false
- end
- function onSelected(mouse)
- mouse.Button1Down:connect(function()onButtonDown(mouse)end)
- mouse.Button1Up:connect(function()onButtonUp(mouse)end)
- end
- script.Parent.Selected:connect(onSelected)
- ------------------------------------------------------End
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement