Hello. I currently have a question. I am trying to create a textbox that changes its text, that I put into an array. The text randomly changes. I made this code:
text = {"Cookie", "Soda", "Cake", "Chips", "Doritos"}
script.Parent.Text = text
function randomizer()
local number = math.random(5)
local last_number = number
if number == last_number then
number = math.random(5)
end
print (text)
wait(2)
end
randomizer()
However, when I run the code, I get this error:
18:23:13.526 - Workspace.Part.SurfaceGui.TextBox.Script:2: bad argument #3 to 'Text' (string expected, got table)
Can anyone help me with this?

2 comments
Edited, attempted to run check with a nil value of 'number'. Dumb me..
It worked! Thank you very much :)