✓ Accepted answer
You gotta use tables in ocasions like these, cuz it makes stuff much easier. And in case you don't know how to work with them, here!
So now, if you want to randomize what he's going to say each time it loops, you gotta do table[i]
that's gonna represnt each element by its index, so after you put all your lines in a table, let's say the first one is "Why me!?!?!?!", if thats the first member of your table, if you print(table[1]), one is the index of the first element, cuz its the first, i hope you got this idea cuz now you can pretty much do another math.random(), and are 2 arguments are gonna be 1, 5 since we have 5 lines to choose from.
local lines = {"Why me!?!?!?!", "This thing's tounge feels weird!!", "WHY COULDN'T HAVE I BEEN A DOCTOR?!!?!?!?!?", "MY RIBS ARE IN MY EYES!! MY EYES!!!!", "I can't escape!!!"}
while true do
wait(math.random(0.5, 5))
game:GetService("Chat"):Chat(script.Parent.Head, lines[math.random(1, 5)]
Enum.ChatColor.Blue)
end
And that should be it, always use tables they are helpful, also your scropt had a lot of uneeded stuff like why did you generate a random number with no use at the start of the loop, and i dont see a why you need to store the math.random arguments 0.5 and 5 in a var.
Happy to help!
2 comments
You need to randomize the line used when chatting.
use tables - local lines = {"line1","line2","line3","line4","line5"}