SnowFox
New Member
- Joined
- May 18, 2008
- Messages
- 264
- Reaction score
- 0
Hey can someone look at this and help me please.
Code:
----Snowfox----
nomoney = '|PLAYERNAME|, Sorry but you do not have enough money'
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
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, 'hi') or msgcontains(msg, 'hello') then
npcHandler:say("Hello |PLAYERNAME| I am a magical wizard from the far west of isula, I sell Health.", cid)
if msgcontains(msg, 'buy hp') or msgcontains(msg, 'buy health') then
npcHandler:say("|PLAYERNAME|, are you willing to pay 10 crystal coins for 10 health points?", cid)
if msgcontains(msg, 'yes') then
if doPlayerRemoveItem(cid,2160,10) then
doCreatureAddHealth(cid, 10)
doSendMagicEffect(getCreaturePosition(cid), 13)
end
else
selfSay(nomoney)
end