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

TFS 1.X+ removing item when dying

Obito

0x1337
Joined
Feb 17, 2011
Messages
350
Solutions
8
Reaction score
144
Location
Egypt
Today i compiled my tfs 1.3 and I'ma quite some big time trying to implement this script into my tfs 1.3 the weird thing there's no errors or anything appear into the console also the player didn't lose that item.
PS: if there's something related with droploot.lua i removed that file because i didn't want the players lose their items so i decided to write it manually from this script if there's a link between them is there's some way to make it from this file? . can someone help? thanks in advance!
Lua:
local amulets = {2173}
 
function onPrepareDeath(cid, deathList)
  local player = Player(cid)
     if not player then
      return false
        local amulet = player:getSlotItem(CONST_SLOT_NECKLACE)
        if not amulet then
            return true
        end
        if isInArray(amulets, amulet.itemid) then    
                item:remove(amulet.uid, 1)        
        end
    end
    return true
end
Lua:
player:registerEvent("remove_item")
XML:
<event type="preparedeath" name="remove_item" event="script" value="remove_item.lua"/>
 
Lua:
local amulets = {2173}

function onPrepareDeath(cid, deathList)
    local player = Player(cid)
    if not player then
        return false
    end

    local amulet = player:getSlotItem(CONST_SLOT_NECKLACE)
    if amulet and isInArray(amulets, amulet.itemid) then  
        amulet:remove()      
    end

    return true
end
 
Back
Top