• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Solved How: if creature leave, set talkState[talkUser] = 0

1268995

Member
Joined
Sep 9, 2010
Messages
422
Reaction score
13
I have a npc are giving talkstate to people.

Example: Player say 'hi' and win talkstate = 1
player say 'love you' and win talkstate = 2

But when player leaves, he still with talkstate npc gaved him.
In example, if he leaves, he will stay with talkstate = 2

I want that when player leave OR SAY BYE, talkstate goes to = 0 again.

IS that possible?

Edit: i see that when player log out, talk state is set to = 0
 
If your having trouble with setting talkstate to 0 when they leave, whenever an npc greets a player you could also set talkstate to 0.
Just a different way of doing it I suppose.
 
If your having trouble with setting talkstate to 0 when they leave, whenever an npc greets a player you could also set talkstate to 0.
Just a different way of doing it I suppose.

But where should i do it? On npc.xml ?
EDIT: and how can i do that?
 
Code:
function greetCallback(cid)
   talkState[cid] = 0
   return true
end

npcHandler:setCallback(CALLBACK_GREET, greetCallback)
this should work, and talkUser is mostly cid unless you're using pre-8.2 NPC systems
 
Code:
function greetCallback(cid)
   talkState[cid] = 0
   return true
end

npcHandler:setCallback(CALLBACK_GREET, greetCallback)
this should work, and talkUser is mostly cid unless you're using pre-8.2 NPC systems

WORKED 100% . LOVE YAAAAAAAAAA
 
Back
Top