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

TFS 1.X+ npc response time tfs 1,5

bpm91

Intermediate OT User
Joined
May 23, 2019
Messages
931
Solutions
7
Reaction score
127
Location
Brazil
YouTube
caruniawikibr
how to make npc speak 1 sentence at a time instead of all

for example i talk to melchior, and he says all the phrases at once
Lua:
function creatureSayCallback(cid, type, msg)
    if not npcHandler:isFocused(cid) then
        return false
    end

     local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid

    if msgcontains(msg, "word of greeting") and getPlayerLevel(cid) >= 30 then
            selfSay("The djinns have an ancient code of honour. This code includes a special concept of hospitality. Anybody who utters the word of greeting must not be attacked even if he is an enemy. Well, at least that is what the code says. ...", cid)
            selfSay("I have found out, though, that this does not work at all times. There is no point to say the word of greeting to an enraged djinn. ...", cid)
            selfSay("I can tell you the word of greeting if you're interested. It is DJANNI'HAH. Remember this word well, stranger. It might save your life one day. ...", cid)
            selfSay("And keep in mind that you must choose sides in this conflict. You can only follow the Efreet or the Marid - once you have made your choice there is no way back. I know from experience that djinn do not tolerate double-crossing.", cid)
            setPlayerStorageValue(cid, 9030,1)
    end
    return true
end


this also happens for example in the runes npc
Lua:
elseif msgcontains(msg, 'rod') or msgcontains(msg, 'Rod') then
   
    npcHandler:say("Rods can be wielded by druids only and have a certain level requirement. There are five different rods, would you like to hear about them?", 1)
    npcHandler:say("The names of the rods are 'Snakebite Rod', 'Moonlight Rod', 'Volcanic Rod', 'Quagmire Rod', and 'Tempest Rod'.", 1)
    talk_state = 1

elseif msgcontains(msg, 'wand') or msgcontains(msg, 'Wand') then
    npcHandler:say("Wands can be wielded by sorcerers only and have a certain level requirement. There are five different wands, would you like to hear about them?", 1)
    npcHandler:say("The names of the wands are 'Wand of Vortex', 'Wand of Dragonbreath', 'Wand of Plague', 'Wand of Cosmic Energy' and 'Wand of Inferno'.", 1)
    talk_state = 2      
end
 
Last edited:
Solution
Please post the solution next time

Solution:
Lua:
npcHandler:say({
    "message_1",
    "message_2"
}, cid)
By default, delay is 6000 ms (6 seconds) between sentences

If you want to easily change the delay, use doNPCTalkALot instead
Lua:
npcHandler:doNPCTalkALot({
    "message_1",
    "message_2"
}, 1000, cid) -- # 1000 ms delay
Please post the solution next time

Solution:
Lua:
npcHandler:say({
    "message_1",
    "message_2"
}, cid)
By default, delay is 6000 ms (6 seconds) between sentences

If you want to easily change the delay, use doNPCTalkALot instead
Lua:
npcHandler:doNPCTalkALot({
    "message_1",
    "message_2"
}, 1000, cid) -- # 1000 ms delay
 
Solution
Back
Top