What I'm trying to do is have any amount of titles/content, and will display in order.
For example
local titles = {
"Need Help?"; --Title 1
"REMEMBER:"; --2
"REMEMBER:"; --3
}
local content = {
"Use the 911 call box to get help!"; --Content 1
"Stick to the speed limit! People are trying not to get hurt!"; --2
"Trespassing is a crime! Trespassing on other's properties will get you arrested!"; --3
}
--The title displays in the corresponding textLabel
--And the content displays in the corresponding textLabel
My full code
local nextMsg = 20
local titles = { --Titles
"Need Help?";
"REMEMBER:";
"REMEMBER:";
}
local content = { --The content
"Use the 911 callbox to get help!";
"Stick to the speed limit! People are trying not to get hurt!";
"Trespassing is a crime! Trespassing on other's properties will get you arrested!";
}
math.randomseed(os.time())
local title = script.Parent.Title
local content = script.Parent.Content
while wait() do
for _, r in ipairs(titles) do
title.Text = titles[_];
content.Text = content[_];
wait(nextMsg)
end
end
If you don't understand what I mean. Please feel free to ask!
[UPDATE]
I am now receiving the error,
15:44:09.226 - 1 is not a valid member of TextLabel
15:44:09.230 - Script 'Workspace.Model.Surface GUI.SurfaceGui.Script', Line 20
15:44:09.233 - Stack End

1 comment
try changing title.Text = titles[_] into title.Text = r, and you need a new loop for content, or use numeric.