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

quest chest dosent work? workt before...

Status
Not open for further replies.

TKO

Syphero Owner!
Joined
Mar 10, 2008
Messages
2,252
Reaction score
27
Location
Sweden
Hey all my chests have been changed since i updated my server to the latest trunk!
They workt before change i dint use any script at all but now they dont work....
They where using uniq id but now they dont work.
can it be becouse that the map is 8.5 and the server is 8.62?

But this did work before!
this script dosent work:
LUA:
local cfg = {
      addItem = 132,
      amount = 1,
      storId = 1001
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
         if getPlayerStorageValue(cid, cfg.storId) == -1 then
            doPlayerAddItem(cid, cfg.addItem, cfg.amount)
            doPlayerSendTextMessage(cid, 22, "You have found " .. getItemArticleById(cfg.addItem) .. " " .. getItemNameById(cfg.addItem) .. ".")
            setPlayerStorageValue(cid, cfg.storId, 1)
            doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_BLUE)
         else
             doPlayerSendTextMessage(cid, 22, "It is empty.")
             doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
         end
         return true
end
 
Dose not work! i can open the chest like numbers of times and i get a error in consol:

[18:12:40.526] [Error - Action Interface]
[18:12:40.528] data/actions/scripts/custom quests/dpchest1.lua:onUse
[18:12:40.528] Description:
[18:12:40.529] attempt to index a nil value
[18:12:40.529] stack traceback:
[18:12:40.530] [C]: in function 'doSendMagicEffect'
[18:12:40.531] data/actions/scripts/custom quests/dpchest1.lua:15: in function
<data/actions/scripts/custom quests/dpchest1.lua:11>
 
just use the old style?

Actionid=2000 on all chests
Uniqueid= anything (storage)

and u put what u want them to get in map editor in the chest :)
 
Chest action ID is 1132
Actions.xml add
Code:
    <action actionid="1132" event="script" value="chest.lua"/>
chest.lua
LUA:
local config = {
    e = 1111 --Storage used
    x = 2164 --reward ID
    c = 1 --count
    v = "You have found reward." --Message
    }
function onUse(cid, item, frompos, item2, topos)
queststatus = getPlayerStorageValue(cid,config.e)
 if queststatus == -1 then
        doPlayerSendTextMessage(cid,22,config.v) 
        doPlayerAddItem(cid,config.x,config.c)
        setPlayerStorageValue(cid,config.e,1)
        else
        doPlayerSendTextMessage(cid,22,"It is empty.")
 end
return 1
end
 
all the other old quest dint use script they just gave out the item.
i just got 2 chest with scripts and they just do the empty part!
And the old style they dint give any they just open like a bag.
 
You must remove the check @ system.lua
LUA:
	if(getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES)) then
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF, cid)
		return true
	end
 
Yea for sure dint think that was the problem but if was that thanks all for the scripts and suggestions closing this thread!
 
Status
Not open for further replies.
Back
Top