Before you read, this script is inserted into a Local Script which is inserted into a Text Label. I have made a counter of 6 seconds but it is not working, any ideas on why it is not working?
local text = "Game found! You will be teleported in 6" wait(1) local text = "Game found! You will be teleported in 5" wait(1) local text = "Game found! You will be teleported in 4" wait(1) local text = "Game found! You will be teleported in 3" wait(1) local text = "Game found! You will be teleported in 2" wait(1) local text = "Game found! You will be teleported in 1" wait(1) local text = "Get ready!"
Because you never set the Text of the textLabel.
local textLabel = script.Parent textLabel.Text = "Words"
Now, instead of typing out that message ten times with different numbers, you could use a for loop.
for q=6, 1, -1 do textLabel.Text = "Game found! You will be teleported in " .. q wait(1) end
Here, we set up a for loop to start at 6, end at 1, and add -1 to the q
variable each time the loop runs, we also concatenate our q
variable to the end of the string.
And as a side note, the following code will not work.
local text = textLabel.Text text = "Words"
In this situation, you set the text variable to whatever the text is in the textLabel, you cannot set the Text property like this.
Type Local text = script.Parent at the top of the code and then remove all the "local " from the code you have right now. Your Problem is that every time it is trying to save the value "text" as something new.