• 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!

Storage id Help

allashal

New Member
Joined
Oct 28, 2009
Messages
16
Reaction score
0
Hello.
I dont get this with storage id.
If i have get it right then it checks if the quest have been made before?
Becuse i have one npc quest, and the players can do it over and over again.
I want to have it so the players just can do the quest one time.

Heres my script

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}

function onCreatureAppear(cid) npcHandler:eek:nCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:eek:nCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:eek:nCreatureSay(cid, type, msg) end
function onThink() npcHandler:eek:nThink() end

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

if msgcontains(msg, 'yes') and doPlayerRemoveItem(cid, 2813, 2) == TRUE then
npcHandler:say('Good work! Here is your reward!', cid)
doPlayerAddExp(cid,100)
else
npcHandler:say('come back when You have them!', cid)
end
return TRUE
end

local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

:confused:
 
try i dont think it work but try :)
Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}

function onCreatureAppear(cid) npcHandlernCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandlernCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandlernCreatureSay(cid, type, msg) end
function onThink() npcHandlernThink() end

function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
if msgcontains(msg, 'yes') and getPlayerStorageValue(cid,98989) == 2 then
npcHandler:say('You have already made it', cid)
return true
end

if msgcontains(msg, 'yes') and doPlayerRemoveItem(cid, 2813, 2) == TRUE then

npcHandler:say('Good work! Here is your reward!', cid)
doPlayerAddExp(cid,100)
setPlayerStorageValue(cid,98989,2)
else
npcHandler:say('come back when You have them!', cid)
end
return TRUE
end

local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}

function onCreatureAppear(cid) npcHandlernCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandlernCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandlernCreatureSay(cid, type, msg) end
function onThink() npcHandlernThink() end

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

if msgcontains(msg, 'yes') and doPlayerRemoveItem(cid, 2813, 2) and
getPlayerStorageValue(cid,9999) == 1 then
npcHandler:say('Good work! Here is your reward!', cid)
doPlayerAddExp(cid,100)
setPlayerStorageValue(cid,9999,0)
else
npcHandler:say('come back when You have them!', cid)
else
npcHandler:say('You already have done this quest!', cid)
end
return TRUE
end

local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())


//fast made
Mokerhamer
 
Back
Top