• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

1 reward from quest, please help!

64883

New Member
Joined
Oct 18, 2010
Messages
6
Reaction score
0
I've maded a quest and now i only want that 1 of this chest are going to be used, please help me how i should do! :)

asdor.png
 
There you go
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if item.actionid >= 42361 and item.actionid <= 42365 and getPlayerStorageValue(cid, 42361) ~= 1 then
        local reward = 0
        if item.actionid == 42361 then
            reward = doCreateItemEx(8928,1)
        elseif item.actionid == 42362 then
            reward = doCreateItemEx(3798,1)
        elseif item.actionid == 42363 then
            reward = doCreateItemEx(7426,1)
        elseif item.actionid == 42364 then
            reward = doCreateItemEx(3962,1)
        elseif item.actionid == 42365 then
            reward = doCreateItemEx(8910,1)
                    elseif item.actionid == 42366 then
            reward = doCreateItemEx(9504 ,1)
        end
        if doPlayerAddItemEx(cid, reward, 0) == RETURNVALUE_NOERROR then
            doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'You found ' .. getItemName(getThing(reward).uid) .. '.')
            setPlayerStorageValue(cid, 42361, 1)
        else
            doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'You do not have enought capacity or place in backpack.')
        end
        
    end
    return TRUE
end
 
Last edited:
thanks for helping but im still not understand how i should do, can you help me the id numbers for rewards is 8928,3798,7426,3962,8910,9504
:D
 
Code:
Quest.lua
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if item.actionid >= 42361 and item.actionid <= 42365 and getPlayerStorageValue(cid, 42361) ~= 1 then
        local reward = 0
        if item.actionid == 42361 then
            reward = doCreateItemEx(8928,1)
        elseif item.actionid == 42362 then
            reward = doCreateItemEx(3798,1)
        elseif item.actionid == 42363 then
            reward = doCreateItemEx(7426,1)
        elseif item.actionid == 42364 then
            reward = doCreateItemEx(3962,1)
        elseif item.actionid == 42365 then
            reward = doCreateItemEx(8910,1)
                    elseif item.actionid == 42366 then
            reward = doCreateItemEx(9504 ,1)
        end
        if doPlayerAddItemEx(cid, reward, 0) == RETURNVALUE_NOERROR then
            doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'You found ' .. getItemName(getThing(reward).uid) .. '.')
            setPlayerStorageValue(cid, 42361, 1)
        else
            doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'You do not have enought capacity or place in backpack.')
        end
        
    end
    return TRUE
end

Code:
   <action fromaid="42361" toaid ="42366" event="script" value="quests/Quest.lua"/>
 
Last edited:
its still dont work, i put action ids on all chest with 42361-66 then i added the script to my script map with the name "exp wep" then i changed the (value="quests/Quest.lua"/>) to (value="quests/exp wep.lua"/>) is there anything you can see thats wrong? :(
 
If you know how the quest system works, you can all give them action ID 2000 and the same unique ID, put the items in the chests and you're done.
 
Back
Top