• 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!

NPC random talks at focus = 0

Tarielle

New Member
Joined
Nov 4, 2007
Messages
214
Reaction score
0
Location
Sweden
Hi, how can I make this script:
Code:
function onThink() 
local random = math.random(3)
if random == 1  then
selfSay("hello")
elseif random == 2 then
selfSay("hi")
elseif random == 3 then
selfSay("hey")
end

end
to make the NPC randomize it each X second?
 
Last edited:
Code:
function onThink() 
    local think = 0
    local random = math.random(3)

    if think = 10 then
        if random == 1  then
            selfSay("hello")
            think = 0
        elseif random == 2 then
            selfSay("hi")
            think = 0            
        elseif random == 3 then
            selfSay("hey")
            think = 0            
        end
    else
        think = think + 1
    end
end
 
Ah, sorry... :P

Code:
    local think = 0

function onThink() 

    local random = math.random(3)

    if think = 10 then
        if random == 1  then
            selfSay("hello")
            think = 0
        elseif random == 2 then
            selfSay("hi")
            think = 0            
        elseif random == 3 then
            selfSay("hey")
            think = 0            
        end
    else
        think = think + 1
    end
end
 
Back
Top