Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wait(0.1)
- sp = script.Parent
- _G.owner = 1
- sp.Gui.Text.Text=('TERMINAL')
- spd=0.5
- GetAllPlayers = function()
- while wait(0.1) do
- def = 0
- atk = 0
- for _,player in pairs(game.Players:GetChildren()) do
- if player.TeamColor==BrickColor.new('Pastel blue') or player.TeamColor==BrickColor.new('Pastel blue') then
- if player.Character~=nil and player.Character:findFirstChild('Torso') and player.Character.Humanoid.Health>0 then
- local dist = (player.Character:findFirstChild("Torso").Position-sp.Position).magnitude
- if dist<=15 then
- def = def + 1
- end
- end
- elseif player.TeamColor==BrickColor.new('Bright red') then
- if player.Character~=nil and player.Character:findFirstChild('Torso') and player.Character.Humanoid.Health>0 then
- local dist = (player.Character:findFirstChild("Torso").Position-sp.Position).magnitude
- if dist<=15 then
- atk = atk + 1
- end
- end
- end
- end
- end
- end
- DefenderFunction = function()
- _G.owner = 1
- sp.Owner.Value=('Defender')
- sp.Gui.Text.Text=('TERMINAL')
- sp.Attacker.Enabled=false
- sp.Neutral.Enabled=false
- sp.Defender.Enabled=true
- for i,v in pairs(sp.Parent:GetChildren()) do
- if v.Name==('Color') then
- v.BrickColor=BrickColor.new('Pastel blue')
- end
- end
- sp.pointScript.Disabled=true
- sp.bombTime.Value=('!SECURED!')
- for _,player in pairs(game.Players:GetChildren()) do
- if player.TeamColor==BrickColor.new('Pastel blue') or player.TeamColor==BrickColor.new('Pastel blue') then
- if player.Character~=nil and player.Character:findFirstChild('Torso') and player.Character.Humanoid.Health>0 then
- local dist = (player.Character:findFirstChild("Torso").Position-sp.Position).magnitude
- if dist<=15 then
- end
- end
- end
- end
- end
- AttackerFunction = function()
- _G.owner = 2
- sp.Owner.Value=('Attacker')
- sp.Gui.Text.Text=('TERMINAL')
- sp.Attacker.Enabled=true
- sp.Neutral.Enabled=false
- sp.Defender.Enabled=false
- for i,v in pairs(sp.Parent:GetChildren()) do
- if v.Name==('Color') then
- v.BrickColor=BrickColor.new('Bright red')
- end
- end
- sp.pointScript.Disabled=false
- for _,player in pairs(game.Players:GetChildren()) do
- if player.TeamColor==BrickColor.new('Bright red') then
- if player.Character~=nil and player.Character:findFirstChild('Torso') and player.Character.Humanoid.Health>0 then
- local dist = (player.Character:findFirstChild("Torso").Position-sp.Position).magnitude
- if dist<=15 then
- end
- end
- end
- end
- end
- pcall(coroutine.resume(coroutine.create(GetAllPlayers)))
- --and workspace.isRaid.Value==true
- while wait(0.1) do
- if _G.owner == 1 and atk>def and workspace.isRaid.Value==true then
- local pnt = 0
- while atk > 0 and pnt < 100 and wait(spd/atk) and workspace.isRaid.Value==true do
- repeat wait() wait() sp.Gui.Text.Text=('UNSECURE') until atk>def or atk<=0
- pnt = pnt + 1
- sp.Gui.Text.Text=(pnt..'%')
- end
- if pnt>=100 then
- AttackerFunction()
- end
- sp.Gui.Text.Text=('TERMINAL')
- elseif _G.owner == 2 and def>atk then
- local pnt = 0
- while def > 0 and pnt < 100 and wait(spd/def) do
- repeat wait() sp.Gui.Text.Text=('UNSECURE') until def>atk or def<=0
- pnt = pnt + 1
- sp.Gui.Text.Text=(pnt..'%')
- end
- if pnt>=100 then
- DefenderFunction()
- end
- sp.Gui.Text.Text=('TERMINAL')
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement