I know that the 'Hint' class is deprecated, but I wanted to test making a countdown.
local Hint = Instance.new("Hint")
Hint.Parent = workspace
local Text = Hint.Text
Text = "5"
while Text > 0 do
wait(1)
Text = Text-1
end -- This code doesn't work, I even tried converting to numbers and to strings
I noticed that I could fix it from instead of using a variable for Text, I edit it directly, why is this?
local Hint = Instance.new("Hint")
Hint.Parent = workspace
workspace.Message.Text = 5
while tonumber(workspace.Message.Text) > 0 do
wait(1)
workspace.Message.Text = workspace.Message.Text -1
print(workspace.Message.Text)
end --This code does work

1 comment
You cannot assign a property of an instance to a variable.