• 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+ If we are killed by a Player or a Guild, we do not lose EQ. (body disappears)

Try this:

data/creaturescripts/scripts/dontdroploot.lua:
Lua:
function onDeath(player, corpse, killer, mostDamageKiller, unjustified, mostDamageUnjustified)
  local goldAmount = 100
  local playerId = player:getId()

  if killer and killer:isPlayer() then
    -- prevent the player from dropping loot
    player:setDropLoot(false)

    -- award gold to the killer
    local killerGold = goldAmount -- set the amount of gold to award
    killer:addMoney(killerGold)

    -- remove the player's body
    corpse:remove()
  end
end

data/creaturescripts/creaturescripts.xml:
XML:
<event type="death" name="DontDropLoot" script="dontdroploot.lua"/>

data/creaturescripts/scripts/login.lua:

Lua:
player:registerEvent("DontDropLoot")
 
Back
Top