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

Lua ? where too configure how often npcs say stuff?

FLE

Member
Joined
Oct 5, 2008
Messages
422
Reaction score
24
Location
Vancouver Canada
It seems the npcs on my server are spamming like every ...10 seconds or so haha... they dont need too talk so much!

Can someone tell me how too fix this? thank you~!

-Martin
 
..below
Code:
function onThink()              npcHandler:onThink()            end
..add
Code:
local lastSound = 0
function onThink()
local rand = math.random(30,40)
local rand1 = math.random(100)
    if lastSound < os.time() then
        lastSound = (os.time() + rand)
        if rand1 < 80 then
            Npc():say("First text message.", TALKTYPE_SAY)
        else
            Npc():say("Second text message.", TALKTYPE_SAY)
        end
    npcHandler:onThink()
    end
end

..remove
Code:
local voices = { {text = 'It\'s a wise idea to store your money in your bank account.'} }
npcHandler:addModule(VoiceModule:new(voices))

or edit npc system :p
 
Back
Top