Im trying to make a terminal but evertime I get close to it, it doesnt work and nothing happens. Please tell me if their is anything wrong with it.
timeuntilwin = 1200
totaltime = 1200
raidteamcolor = "Really blue"
defendteamcolor = "Really red"
h = Instance.new("Hint")
function OnTouched(hit)
if hit.Parent:findFirstChild("Humanoid") ~= nil then
if game.Players:GetPlayerFromCharacter(hit.Parent).TeamColor == BrickColor.new(raidteamcolor) then
script.Parent.BrickColor = BrickColor.new(raidteamcolor)
end
if game.Players:GetPlayerFromCharacter(hit.Parent).TeamColor == BrickColor.new(defendteamcolor) then
script.Parent.BrickColor = BrickColor.new(defendteamcolor)
timeuntilwin = totaltime
for i, v in pairs(game.Workspace:GetChildren()) do
if v:IsA("Hint") then
v:remove()
end
end
end
end
end
script.Parent.Touched:connect(OnTouched)
while true do
wait()
if script.Parent.BrickColor == BrickColor.new(raidteamcolor) then
h.Parent = game.Workspace
h.Text = "Raiders win in".." "..timeuntilwin
if timeuntilwin <= totaltime and timeuntilwin > 0 then
wait(1)
timeuntilwin = timeuntilwin - 1
end
if timeuntilwin == 0 then
h:remove()
winmsg = Instance.new("Message")
winmsg.Parent = game.Workspace
winmsg.Text = "Raiders have won!"
wait(5)
winmsg:remove()
script.Parent.BrickColor = BrickColor.new(defendteamcolor)
timeuntilwin = totaltime
end
end
end

1 comment
OnTouched is a function called by a event, if it had different capitalization then you may point it out but it's correct. And the color is the BrickColor name, the OP does not want the Color3 Value.