--The text displays as the intermission() when the boolean GameInProgress == true. There are no syntax errors so I don't know what's wrong. local seconds = game.ReplicatedStorage.Time
script.Parent.Text = "Loading"
game.ReplicatedStorage:WaitForChild("GameInProgress")
if game.ReplicatedStorage.GameInProgress == true then
script.Parent.Text = game.ReplicatedStorage.MapName.Value.." ("..seconds.Value..")"
else
script.Parent.Text = "Intermission ("..seconds.Value..")"
end
What you are doing right now is simply checking if the object itself equals true, which will never be true.
You meant to check the value of GameInProgress
.
```lua local ReplicatedStorage = game:GetService("ReplicatedStorage"); local seconds = ReplicatedStorage.Time; local inProgress = ReplicatedStorage.GameInProgress; local mapName = ReplicatedStorage.MapName; local label = script.Parent;
label.Text = string.format("%s (%d)", inProgress.Value and mapName.Value or "Intermission", seconds.Value); ```
~~where is ternary operator eeeee~~
"%s"
is a string in string.format
, "%d"
is a digit.
~~%s is whitespace everywhere else but string.format~~
There are no syntax errors so I don’t know what’s wrong.
Syntax errors aren't the only reason programs don't work.
There are runtime errors, errors that occur whilst your code is running, and logic errors, which aren't actual errors, but flaws with your code structure.