View difference between Paste ID: HHCaQqsT and 6Le29B7w
SHOW: | | - or go back to the newest paste.
1
wait(0.1)
2
sp = script.Parent
3
_G.owner = 1
4
sp.Gui.Text.Text=('TERMINAL')
5
spd=0.5
6
7
GetAllPlayers = function()
8
	while wait(0.1) do
9
		def = 0
10
		atk = 0
11
		for _,player in pairs(game.Players:GetChildren()) do
12
			if player.TeamColor==BrickColor.new('Pastel blue') or player.TeamColor==BrickColor.new('Pastel blue') then
13
				if player.Character~=nil and player.Character:findFirstChild('Torso') and player.Character.Humanoid.Health>0 then
14
					local dist = (player.Character:findFirstChild("Torso").Position-sp.Position).magnitude
15
					if dist<=15 then
16
						def = def + 1
17
					end			
18
				end			
19
			elseif player.TeamColor==BrickColor.new('Bright red') then
20
				if player.Character~=nil and player.Character:findFirstChild('Torso') and player.Character.Humanoid.Health>0 then
21
					local dist = (player.Character:findFirstChild("Torso").Position-sp.Position).magnitude
22
					if dist<=15 then
23
						atk = atk + 1
24
					end			
25
				end
26
			end
27
		end
28
	end
29
end
30
31
DefenderFunction = function()
32
	_G.owner = 1
33
	sp.Owner.Value=('Defender')
34
	sp.Gui.Text.Text=('TERMINAL')
35
	sp.Attacker.Enabled=false
36
	sp.Neutral.Enabled=false
37
	sp.Defender.Enabled=true
38
	for i,v in pairs(sp.Parent:GetChildren()) do
39
		if v.Name==('Color') then
40
			v.BrickColor=BrickColor.new('Pastel blue')
41
		end
42
	end
43
	sp.pointScript.Disabled=true
44
	sp.bombTime.Value=('!SECURED!')
45
	for _,player in pairs(game.Players:GetChildren()) do
46
		if player.TeamColor==BrickColor.new('Pastel blue') or player.TeamColor==BrickColor.new('Pastel blue') then
47
			if player.Character~=nil and player.Character:findFirstChild('Torso') and player.Character.Humanoid.Health>0 then
48
					local dist = (player.Character:findFirstChild("Torso").Position-sp.Position).magnitude
49
				if dist<=15 then
50-
					--_G.createTag(_G.KillMedals['CAPTURE']['NAME'],_G.KillMedals['CAPTURE']['POINTS'],player.KillFeed)
50+
51
			end	
52
		end
53
	end
54
end
55
56
AttackerFunction = function()
57
	_G.owner = 2
58
	sp.Owner.Value=('Attacker')
59
	sp.Gui.Text.Text=('TERMINAL')
60
	sp.Attacker.Enabled=true
61
	sp.Neutral.Enabled=false
62
	sp.Defender.Enabled=false
63
	for i,v in pairs(sp.Parent:GetChildren()) do
64
		if v.Name==('Color') then
65
			v.BrickColor=BrickColor.new('Bright red')
66
		end
67
	end
68
	sp.pointScript.Disabled=false
69
	for _,player in pairs(game.Players:GetChildren()) do
70
		if player.TeamColor==BrickColor.new('Bright red') then
71
			if player.Character~=nil and player.Character:findFirstChild('Torso') and player.Character.Humanoid.Health>0 then
72
					local dist = (player.Character:findFirstChild("Torso").Position-sp.Position).magnitude
73
				if dist<=15 then
74
				end			
75-
					--_G.createTag(_G.KillMedals['CAPTURE']['NAME'],_G.KillMedals['CAPTURE']['POINTS'],player.KillFeed)
75+
76
		end
77
	end
78
end
79
80
pcall(coroutine.resume(coroutine.create(GetAllPlayers)))
81
82
--and workspace.isRaid.Value==true
83
84-
--and workspace.Outpost.isRaid.Value==true
84+
85
	if _G.owner == 1 and atk>def and workspace.isRaid.Value==true then
86
		local pnt = 0
87
		while atk > 0 and pnt < 100 and wait(spd/atk) and workspace.isRaid.Value==true do
88
			repeat wait() wait() sp.Gui.Text.Text=('UNSECURE') until atk>def or atk<=0
89
			pnt = pnt + 1
90
			sp.Gui.Text.Text=(pnt..'%')
91
		end
92
		if pnt>=100 then
93
			AttackerFunction()
94
		end
95
		sp.Gui.Text.Text=('TERMINAL')
96
	elseif _G.owner == 2 and def>atk then
97
		local pnt = 0
98
		while def > 0 and pnt < 100 and wait(spd/def) do
99
			repeat wait() sp.Gui.Text.Text=('UNSECURE') until def>atk or def<=0
100
			pnt = pnt + 1
101
			sp.Gui.Text.Text=(pnt..'%')
102
		end
103
		if pnt>=100 then
104
			DefenderFunction()
105
		end
106
		sp.Gui.Text.Text=('TERMINAL')
107
	end
108
end