Hi, I have a npc which should change my temple (where i respawn) but it doesn't seem to work, it doesn't respawn me in the new town I chose, and it doesnt write the town_id to the database. How to fix this?
My script:
I'm thankful for any help!
My script:
PHP:
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, "yes")) then
if getPlayerItemCount(cid, 2160) >= 750 then
npcHandler:say("Welcome! You are now a citizen of VIP City!", cid)
doPlayerSetTown(cid, 2)
doPlayerRemoveMoney(cid, 7500000)
else
npcHandler:say("Sorry but you don't have enough money!", cid)
end
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
I'm thankful for any help!