I am using a hint to show the intermission time or round time In my game. When I join, nothing appears.
Code:
-- Main Game Script for Sword Fighting Arena
local timer = Instance.new("Hint")
local interTime = 30 -- intermission time in seconds
local roundTime = 180
local gameMode = "Intermission"
timer.Parent = game.Workspace
-- Necessary functions
local chosenMap = Instance.new("IntValue")
local newMap = function()
local map
local message
chosenMap.Value = math.random(1) -- range of 1 and the number of maps i.e 1,3
-- Get the map from replicated storage of the chosen map and clone it to workspace
if chosenMap.Value == 1 then
-- Generate a message saying the chosen map
message = Instance.new("Message")
message.Text = "The chosen map is Classic!"
message.Parent = game.Workspace
wait(2)
message:Destroy()
-- Clone the map to the workspace
map = game.ReplicatedStorage.Classic:Clone() -- clone to the workspace
map.Parent = game.Workspace
end
end
local decrementTimer = function()
wait(1)
if gameMode == "Intermission" then
if interTime < 0 then
gameMode = "Round"
interTime = 30
else
timer.Text = ("Intermission time: " + tostring(interTime))
interTime = interTime - 1
end
elseif gameMode == "Round" then
if roundTime < 0 then
gameMode = "Intermission"
roundTime = 180
else
timer.Text = ("Round time: " + tostring(roundTime))
roundTime = roundTime - 1
end
end
end
-- Main game loop
while true do
wait(1)
decrementTimer()
end
Thanks in advance.
