There spawns in 2 hints when it does the countdown 1 for defending team and 1 for raiding team...
Anyone able to help?
local wintime = 1200
local timegodown = 1 -- how many seconds of time go down for the term
local h = Instance.new("Hint")
script.Parent.Touched:connect(function(hit)
if hit.Parent:findFirstChild("Humanoid") ~= nil then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
if player.TeamColor == BrickColor.new("Really black") then
script.Parent.BrickColor = BrickColor.new("Really black")
h.Parent = game.Workspace
h.Text = "The Necromongers Own the Term!"
wait(3)
h:Remove()
else
if player.TeamColor == BrickColor.new("Really red") then
script.Parent.BrickColor = BrickColor.new("Really red")
h.Parent = game.Workspace
h.Text = "The Raiders Own the Term!"
wait(3)
h:Remove()
end
while wait() do
if script.Parent.BrickColor == BrickColor.new("Really black") then
h.Parent = game.Workspace
while wait(1.5) do
wintime = wintime-timegodown -- This assigns a new value to wintime each time thus dropping it by 1 each time giving you the result I believe you're looking for.
h.Text = "The Necromongers have " .. wintime .. " seconds left before Winning!"
if h.Text == "The Necromongers have 0 seconds left before Winning!" then
h:Remove()
local m = Instance.new("Message")
m.Parent = game.Workspace
m.Text = "The Necromongers Have Won!"
wait(15)
m:Remove()
else
if script.Parent.BrickColor == BrickColor.new("Really red") then
h.Parent = game.Workspace
while wait(1.5) do
wintime = wintime-timegodown
h.Text = "The Raiders have ".. wintime .. " seconds left before Winning!"
if h.Text == "The Raiders have 0 seconds left before Winning!" then
h:Remove()
local m = Instance.new()
m.Parent = game.Workspace
m.Text = "Raiders have Won!"
wait(15)
m:Remove()
end
end
end
end
end
end
end
end
end
end
end)

2 comments
So what exactly is the problem and where is the problem located?
Perci, I have no clue where the problem is, All I know is, is that it Makes 2 hints instead of Making 1, and changing it/ Deleting the first 1 to make a new one.