Hello, I am trying to make this print a random word, but I get, interval is empty. Any suggestions?
local Test = {
Oof = “Oof”,
yes = “Yes”,
}
local Picker = Test[math.random(1,#Test)]
print(Picker)
Hello, I am trying to make this print a random word, but I get, interval is empty. Any suggestions?
local Test = {
Oof = “Oof”,
yes = “Yes”,
}
local Picker = Test[math.random(1,#Test)]
print(Picker)
You could do this if it’s multiple values together.
local Test = {
{Oof = "Oof"},
{yes = "Yes"},
}
local Picker = Test[math.random(#Test)]
print(Picker)
Or just like that.
local Test = {
"Oof",
"Yes",
}
local Picker = Test[math.random(#Test)]
print(Picker)
I just tried what you suggested, and it gives me this error. “ServerScriptService.Script:10: attempt to get length of a Instance value”
I’m sorry, it works! Thanks so much for taking the time to help me!
You’re welcome, happy to help ^ - ^