• 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] Problem with delay

tarjei

Necronian Engineer
Joined
May 25, 2008
Messages
505
Reaction score
126
Location
Poland
I have a problem with delay I made with Ispiro help.

When 1 player say to npc a keyword then everything is fine..
But when more players talk to npc in the same time:
When 1 player say a keyword delay starts..
When 2nd players talk to npc, npc change target and talks to this 2nd player..

I tried to explain it clear and I hope you know what I mean.

Ohh and here is code with delay:
Code:
function onThink()				npcHandler:onThink()
 if isPlayer(focus) == TRUE then

	ts = getPlayerStorageValue(focus, id)

	if ts == 30 and (os.clock() - time) > 5 then
		npcHandler:say('who manage to master the test are granted the title of an honorary barbarian and the respect of our people 

... ', focus)
		talk_start = os.clock()
		talkset(focus,id,31)
	end
	if ts == 31 and (os.clock() - talk_start) > 5 then
		npcHandler:say('Are you willing to take {the} {barbarian} {test}? ', focus)
		talk_start = os.clock()
		talkset(focus,id,3)
	end
--------------------------------------------------------------------------------------
end

Thank you for any help. =]

@PS I used SV except talk_state beacouse i though it will solve the problem
 
Last edited:
Move delay for NPCs to sources, as it was some time before in TFS. So you could use:
selfSay("Woooo ", cid, 5000) - 5000 = delay

AddEvents and other things won't work there ;s

And also delay isn't working property for NPCs, sometimes they answer after 0.5s, and sometimes there is 0 delay.
 
Hmm too bad beacouse for me it isn't workink ;(
Maybe Tala~ will do something with this ? =]

So for now there isn't any way to make delay without bugs?

@Edit

You were wrong Slawkens =] It is possible to make it in addEvent:D
 
Last edited:
Anyone solved it already?
__________________
klekSu.png

You are welcome on kleksoria.com!
Please visit new open tibia forum with it's own ots list. otservers.net!
 
Last edited:
Back
Top