This is how I'd do it if I'm not misinterpreting your question: when you click the button, it will show through all available texts and loop back to the beginning.
local tc =
local text1 = "Text 1."
local text2 = "Text 2."
local text3 = "Text 3."
local texttable = {text1, text2, text3}
local i = 1
function onclicked()
tc.Text = texttable[i]
if i == #texttable then
i = 1
else
i = i + 1
end
end
script.Parent.MouseButton1Click:Connect(onclicked)
Unless you want it to go to the end and not loop back, you can change it so that if i == #texttable then you make the button you push not visible.
3 comments
wait so what do you need to happen. can you give me a bit more detail
when you click, it will change the text that is in a box. Like a click to continue. It gives you text and when you click, it changes the text then if you click again it'll change the text, etc.
what you could do is make more than one button and they are called Continue1, Continue2, etc. Then if you press Continue1, set the text to Text1, and make Continue1.Visible = false, and Continue2.Visible = true. Then when you press Continue2, set the text to text2, and make Continue.Visible = false and Continue3.Visible = true