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

Solved custom_droploot.lua not working

Demnish

Tibian Hero
Joined
Sep 28, 2011
Messages
402
Solutions
2
Reaction score
65
Location
Sweden
SOLVED

TFS 1.2

custom_droploot.lua:
Code:
local itemDeathDrop = ITEM_PLATINUM_COIN
local itemAmount = 10

function onDeath(player, corpse, killer, mostDamage, unjustified, mostDamage_unjustified)
    if getPlayerFlagValue(player, PlayerFlag_NotGenerateLoot) or player:getVocation():getId() == VOCATION_NONE then
        return true
    end
   
    local master = killer:getMaster()
    if killer:isPlayer() then
        killer:addItem(itemDeathDrop, itemAmount)
    elseif killer:isMonster() and master:isPlayer() then
        master:addItem(itemDeathDrop, itemAmount)
    end
    return true
end
<event type="death" name="CustomDropLoot" script="custom/customdroploot.lua" />
I have no idea why it won't work.


As usual, any help is greatly appreciated!
 
Last edited:
you need to add return true before the last end
Done.

However it still won't work, it's wierd because it should.
At least when I look at the code it doesn't looks like there is any problems? :confused:

EDIT: Added the original droploot.lua to my first post.

EDIT2: Nvm, fml, forgot to register it in login.lua.. :rolleyes:

Thank you Vulcan_!
 
Last edited:
Just tested it in a fresh TFS install and is working properly, are you sure you registered it in login.lua?
LUA:
player:registerEvent("CustomDropLoot")

Ignore my post just saw your edit rofl.
 
Back
Top