• 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 Change the GREET message "on the fly"

TiuTalk

PHP Developer
Joined
Jan 7, 2009
Messages
89
Reaction score
0
Location
Rio de Janeiro - Brasil
Hi there...

Can anyone tell me how I chage the greeting message of the npc based on char storage values? I mean... inside of it script...

Example:
Before the quest: Hiho <name>, can you help me?
After the quest: Yay <name>! You're back! :D

Bye~
 
You can have the NPC set one of the players storage values to something when they talk to them the first time, and have it check for the storage value when he comes back, if its changed then display the second message.

Hope it helped. -MyndGamez
 
Code:
function greetCallback(cid)
    if(getPlayerStorageValue(cid, storage) ~= 1 then
        npcHandler:say('Hello, |PLAYERNAME|.')
        return true
    else
	npcHandler:say('Oh, You\'re back, |PLAYERNAME|!')
        return true
    end
end

npcHandler:setCallback(CALLBACK_GREET, greetCallback)
 
@up your script will only say the message, but never talk to the player.


You also need something like npcHandler:addTarget or something like that (I'll take a look when I get home)
 
Back
Top