How to make a random text generator

You don’t need the sentencechosen variable as you have an array, as well as the fact that you never loop it so the value will only update once. I’d recommend something like such:

local running = true
local sentences = {
	"bro rlly stop dying",
	"is this thing on?",
	"michael jackson is dead",
	"beeschurger",
	"if you die, then stop dying"
}
local textLabel = script.Parent

while running do
   task.wait(2)
 
   local randomSentence = sentences[math.random(1, #sentences)] 
   if randomSentence ~= textLabel.Text then 
 
      textLabel.Text = randomSentence -- Set the textLabels text to the rand sentence
  
   end
end
3 Likes