• 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 hitlist NPC

tiddpd

PHP Scripter
Joined
Apr 16, 2008
Messages
331
Reaction score
0
I got a start on an npc that will add players to a hit list then I got stumped. This is the code

Code:
function creatureSayCallback(cid, type, msg)
	if(not npcHandler:isFocused(cid)) then
		return false
	end

	 local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
	 local storage = getPlayerStorageValue(cid, valueid)
	
	if(msgcontains(msg, 'kill') or msgcontains(msg, 'hit')) then
			selfSay('Who would you like to put on the hitlist?', cid)
			talkState[talkUser] = 1

	elseif(talkState[talkUser] == 1) then
			selfSay('Would you like to add ' ..msg.. ' to the hit list for 500 gold?', cid)
			talkState[talkUser] = 2

	elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 2) then
	selfSay(' ', cid)
	end
 end
After he asks if you want to add the player to hitlist for 500 gold, I need the name that the person said to be remembered somehow so that when they say 'yes' it will submit a query to database. I can't do that using the 'msg' variable because thats going to be changed to 'yes' when they say 'yes'. Anyone know how to do this?

And another off topic question, can you have more than 1 item for a the design of an item. Example 2 different armors for the same look of the demon armor.
 
Back
Top