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

Lua Items - death - lose

Mr Zool

New Member
Joined
Jul 5, 2012
Messages
216
Reaction score
2
I want to make something like this :

Player making quest getting reward item id : "8266"
Then he die while he was wearing this item "8266" and i want him to lose it.
With chance to make quest again "after death ofc"

any idea?
 
Do not forget to register it in creaturescripts.xml and login.lua, not tested
Code:
local config = {
    itemid = 8266,                     -- your item
    removeAll = true,                 -- should it remove all of the item or just 1
    questStorage = {93939, -1}  -- the storage you get for the quest and what it should be set to
}

function onDeath(cid, deathList, _)
    local count = getPlayerItemCount(cid, config.itemid)
    if count > 0 then
        doPlayerRemoveItem(cid, config.itemid, (config.removeAll and count or 1))
        doCreatureSetStorage(cid, config.questStorage[1], config.questStorage[2])
    end
    return true
end
 
Last edited:
Back
Top