• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

random word from table

kacpersky

Mr. Brightside
Joined
Jan 25, 2009
Messages
499
Reaction score
3
im creating some npc. This is like a riddle : Player have to say message but this message is a word one from 4. And npc randomly check if its corect. Im trying to do something like this:

local word = {msgA, msgB, msgC, msgD}
local rando = word[math.rand(1,4)]

if msgcontains(msg, 'word') == rando

how i can get a random word from this table ? and how i can check with said value ?
 
it doesnt work :)
PHP:
bad argument #1 to 'random' (interval is empty)


PHP:
local word = {A,B,C,D}
local wornd = word[math.random(1,4)]

with this, i havent errors on console.

But now how i can wornd check with said word ?
 
try this donno
Lua:
local word = {A,B,C,D} 
local wornd = word[math.random(1,4)]  
if msgcontains(msg, 'wornd') then
 
Back
Top Bottom