i want to have hints on a board in my game, that will randomly switch between them, i've tried to use this scripts
local listOfPhrases = {"Example", "Whatever you want", "Hello, world!", "LOL!"} local interval = 3 while wait() do for k,v in pairs(listOfPhrases) do script.Parent.Name = Hints wait(interval) end end
What is "Hints"? You did not define that anywhere. You should use the variables k,v. Or to make things clear, use _,phrase instead. pairs can use any variable. Lastly, for TextLabels to display text you should use the Text property.
local listOfPhrases = {"Example", "Whatever you want", "Hello, world!", "LOL!"} local interval = 3 while true do for _,phrase in pairs(listOfPhrases) do script.Parent.Text = phrase wait(interval) end end