• 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.3] How to Do Player No Drop Loot When Die?

Yan18

Member
Joined
Jun 14, 2014
Messages
104
Solutions
3
Reaction score
17
Hello guys!

How to do players no drop loot when die? I tried to add:

Lua:
player:setDropLoot(false)

In events onLogin(), onDeath() and onPrepareDeath(), but didn't work.
 
Solution
The event responsible for such mechanics is the:

data/creaturescripts/creaturescripts.xml
XML:
<event type="death" name="DropLoot" script="droploot.lua" />
Inside the droploot.lua file you can add some storage verification to cancel this behavior
per example:
Lua:
if player:getStorageValue(10000) ~= -1 then
        return true
end

data/creaturescripts/scripts/droploot.lua
1637731790069.png


Now we can give the player the storage and he will already be protected from falling objects
Lua:
player:setStorageValue(10000, 1)

If we want the storage to be restored, we just add that to the code
Lua:
player:setStorageValue(10000, -1)
1637731998826.png

There are other ways to do it, but here I showed you this
The event responsible for such mechanics is the:

data/creaturescripts/creaturescripts.xml
XML:
<event type="death" name="DropLoot" script="droploot.lua" />
Inside the droploot.lua file you can add some storage verification to cancel this behavior
per example:
Lua:
if player:getStorageValue(10000) ~= -1 then
        return true
end

data/creaturescripts/scripts/droploot.lua
1637731790069.png


Now we can give the player the storage and he will already be protected from falling objects
Lua:
player:setStorageValue(10000, 1)

If we want the storage to be restored, we just add that to the code
Lua:
player:setStorageValue(10000, -1)
1637731998826.png

There are other ways to do it, but here I showed you this
 
Solution
The event responsible for such mechanics is the:

data/creaturescripts/creaturescripts.xml
XML:
<event type="death" name="DropLoot" script="droploot.lua" />
Inside the droploot.lua file you can add some storage verification to cancel this behavior
per example:
Lua:
if player:getStorageValue(10000) ~= -1 then
        return true
end

data/creaturescripts/scripts/droploot.lua
View attachment 63556


Now we can give the player the storage and he will already be protected from falling objects
Lua:
player:setStorageValue(10000, 1)

If we want the storage to be restored, we just add that to the code
Lua:
player:setStorageValue(10000, -1)
View attachment 63557

There are other ways to do it, but here I showed you this
Thanks 😊! It works!
 
Back
Top