Hey, I've got this script for my king, but for some reason it's not working.. In-game, this shows up...
This is the script..
Code:
07:56 King Arthur: Greetings mighty warrior, I am in deep need of help, would you help me?
07:56 Arthur [15]: help
07:56 King Arthur:
This is the script..
Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local Topic = {}
local storage = 60010 ---- storage value
local dildo = 2357 --- item id of the item princess gives u
local reward = 2091 --- item id of the reward
local aid = 3141 ---- the aid that the key will have
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 greetCallback(cid)
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
Topic[talkUser] = 0
return true
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, "help") and getPlayerStorageValue(cid, storage) < 1 then
npcHandler:say({'You look like a mighty brave adventurer. Would you be willing to {help} me?'}, cid)
Topic[talkUser] = 1
elseif msgcontains(msg, "yes") and Topic[talkUser] == 1 then
npcHandler:say({'I\'ve heard some rumours of my daughter; Princess Mandy being kidnapped by the sultan and his tribes people. Please bring information of my daughter\s well-being.'}, cid)
setPlayerStorageValue(cid, storage, 1)
Topic[talkUser] = 0
elseif getPlayerStorageValue(cid, storage) == 1 and msgcontains(msg, "ring") then
npcHandler:say({'You have returned, I assume you found my child.. Have you?'}, cid)
Topic[talkUser] = 2
elseif msgcontains(msg, "yes") and Topic[talkUser] == 2 and getPlayerItemCount(cid, dildo) == 1 then
npcHandler:say({'My daughter Mandy is alive?! Thank you so much for returning her ring. Here\'s the key to the town prison. Perhaps you\'ll someday find something interesting going on in there. ', '', ''}, cid)
doItemSetAttribute(doPlayerAddItem(cid,reward,1), 'aid', aid)
doPlayerRemoveItem(cid, dildo, 1)
setPlayerStorageValue(cid, storage, 2)
Topic[talkUser] = 0
elseif msgcontains(msg, "no") and Topic[talkUser] == 2 or Topic[talkUser] == 1 then
npcHandler:say({'Please, find me my daugther! Bring me proof of her existance!'}, cid)
Topic[talkUser] = 0
end
return TRUE
end