Ecstacy
Mothafuckaaa
Hello,
I'm not good at making NPC's obviously, but could someone tell my why this NPC won't greet me/work ?
Token Exchanger.xml
tokens.lua
Thanks in advance,
unknown666
I'm not good at making NPC's obviously, but could someone tell my why this NPC won't greet me/work ?
Token Exchanger.xml
Lua:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Token Exchanger" script="tokens.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="212" head="20" body="30" legs="40" feet="50" corpse="6054"/>
<parameters>
<parameter key="message_greet" value="Greetings |PLAYERNAME|. I exchange tokens for 'items'." />
</parameters>
</npc>
tokens.lua
Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
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
-- CONFIG --
newitem = "Here you go, glad to be doing bussiness with you!"
noitems = "You don't have enough tokens to pay for that."
-- Yalahari Mask --
function YalahariMask(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end
if msgcontains(msg, 'yalahari mask') then
if getPlayerStorageValue(cid, 11551) then
if getPlayerItemCount(cid, 9020) >= 10 then
if doPlayerRemoveItem(cid, 9020, 10) then
selfSay(newitem, cid)
doPlayerGiveItem(cid, 9778)
else
selfSay(noitems, cid)
end
else
selfSay(noitems, cid)
end
end
end
end
Thanks in advance,
unknown666