local button = script.Parent
local countdownDuration = 30
local countdownText = "Free Answer in %d..."
local endCountdownText = "Click for free answer"
local textLabel = script.Parent.Parent.Display
local player = game.Players.LocalPlayer
local currentStageValue = player:WaitForChild("CurrentStage")
local isCountdownInProgress = false
local function startCountdown()
if not isCountdownInProgress then
isCountdownInProgress = true
for i = countdownDuration, 0, -1 do
button.Text = string.format(countdownText, i)
wait(1)
end
button.Text = endCountdownText
textLabel.Text = currentStageValue.Value
isCountdownInProgress = false
end
end
button.MouseButton1Click:Connect(startCountdown)
when i press the button, it does not update the text of textLabel. it does not give me any errors in the output either. the value saved within the player is a stringvalue.