If you were able to figure out that for me, can you help me figure out this:
local win = false
local currown
local raidtime = 0
local bodtime = 0
local plrtype
local bricks = script.Parent.Parent.Parent.xS:children()
local center = script.Parent.Parent.Parent.Center
local children = game.Players:GetChildren()
function Time(o)
while o == currown do
if currown == "Raiders" then
wait(3)
if bodtime > 0 then
bodtime = bodtime - 1
for i = 1, #children do
local hint = children[i].PlayerGui.flag.Frame.Label
hint.Text = "Losing: SNAC " .. tostring(bodtime) .. "%!"
end
print("well were losing xD")
elseif bodtime == 0 and raidtime < 100 then
wait(3)
raidtime = raidtime + 1
for i = 1, #children do
local hint = children[i].PlayerGui.flag.Frame.Label
hint.Text = "Winning: ~Raiders~ " .. tostring(raidtime) .. "%!"
end
elseif raidtime == 100 then
for i = 1, #children do
local hint = children[i].PlayerGui.flag.Frame.Label
hint.Text = "Raiders have won!"
end
win = true
wait(15)
win = false
raidtime = 0
bodtime = 0
currown = nil
for i = 1, #children do
local hint = children[i].PlayerGui.flag.Frame.Label
hint.Text = "No one has the base."
end
end
elseif currown == "SNAC" then
wait(3)
if raidtime > 0 then
raidtime = raidtime - 1
for i = 1, #children do
local hint = children[i].PlayerGui.flag.Frame.Label
hint.Text = "Losing: ~Raiders~ " .. tostring(raidtime) .. "%!"
end
elseif raidtime == 0 and bodtime < 100 then
wait(6)
bodtime = bodtime + 1
for i = 1, #children do
local hint = children[i].PlayerGui.flag.Frame.Label
hint.Text = "Winning: SNAC " .. tostring(bodtime) .. "%!"
end
elseif bodtime == 100 then
for i = 1, #children do
local hint = children[i].PlayerGui.flag.Frame.Label
hint.Text = "SNAC has won!"
end
win = true
wait(15)
win = false
raidtime = 0
bodtime = 0
currown = nil
for i = 1, #children do
local hint = children[i].PlayerGui.flag.Frame.Label
hint.Text = "No one has the base."
end
end
end
end
return
end
function Claim()
for i = 1, 34 do
wait()
center.Mesh.Scale = Vector3.new(3+(i/2),3+(i/2),3+(i/2))
end
for i = 0, 10, 1 do
wait()
center.Reflectance = (i/10)
end
if plrtype == 1 then
currown = "Raiders"
for i = 1, #children do
local hint = children[i].PlayerGui.flag.Frame.Label
hint.Text = "Raiders have captured the Flag!"
end
center.BrickColor = game.Teams.Raiders.TeamColor
for i = 1, #bricks do
bricks[i].BrickColor = game.Teams.Raiders.TeamColor
end
elseif plrtype == 0 then
currown = "SNAC"
for i = 1, #children do
local hint = children[i].PlayerGui.flag.Frame.Label
hint.Text = "SNAC has captured the Flag!"
end
center.BrickColor = BrickColor.new("Bright red")
for i = 1, #bricks do
if bricks[i].Name == "Red" then
bricks[i].BrickColor = BrickColor.new("Bright red")
elseif bricks[i].Name == "Really black" then
bricks[i].BrickColor = BrickColor.new("Really black")
end
end
end
for i = 10, 0, -1 do
wait()
center.Reflectance = (i/10)
end
for i = 34, 1, -1 do
wait()
center.Mesh.Scale = Vector3.new(3+(i/2),3+(i/2),3+(i/2))
end
Time(currown)
end
function onSelect(plr,x)
if win == true then return end
if x == script.Parent.Dialog.Check then
if plr.TeamColor == game.Teams.Raiders.TeamColor then
if currown == "Raiders" then
script.Parent.Dialog.Check.Claim.ResponseDialog = "You already have the base."
plrtype = 2
else
script.Parent.Dialog.Check.Claim.ResponseDialog = "Claiming the base for Raiders."
plrtype = 1
end
else
if currown == "SNAC" then
script.Parent.Dialog.Check.Claim.ResponseDialog = "You already have the base."
plrtype = 2
else
script.Parent.Dialog.Check.Claim.ResponseDialog = "Claiming the base for SNAC."
plrtype = 0
end
end
elseif x == script.Parent.Dialog.Check.Claim then
if plrtype ~= 2 then
Claim()
end
end
end
script.Parent.Dialog.DialogChoiceSelected:connect(onSelect) |