• 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+ TFS1.5 Is there a way to change a storage value if a player is killed by a certain monster?

dyl12189

New Member
Joined
Nov 4, 2023
Messages
13
Reaction score
1
Hello,

I am trying to change the value of a player's storage if they are killed by a monster (for the Svargrond arena) but I am not sure how to do it.

Thank you for any help!
 
Wouldn't you just use the onDeath event?

data/scripts
Lua:
local creatureevent = CreatureEvent("svargrondDeath")

function creatureevent.onDeath(creature, corpse, killer, mostDamageKiller, lastHitUnjustified, mostDamageUnjustified)
    -- do your modications / checks here
    return true
end

creatureevent:register()

-- login event to register the onDeath to the player
local creatureevent = CreatureEvent("registerSvargrondDeath")

function creatureevent.onLogin(player)
    player:registerEvent("svargrondDeath")
    return true
end

creatureevent:register()
 
Back
Top