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

Lua TFS 1.5 7.72 - Nekiro Downgrade - RevScript Does not lose exp, items Dead

Forkz

Well-Known Member
Joined
Jun 29, 2020
Messages
380
Solutions
1
Reaction score
89
Hi outlanders,
I'm looking for a script according to the title where the player with a configured level does not lose items, level, skills, NOTHING when he dies.

If anyone can help me I would be grateful!
 
@Forkz
I believe the easiest way to get what you want is to use onpreparedeath

Lua:
----- CREATUREEVENT -----
local creatureevent = CreatureEvent("levelDeath")
function creatureevent.onPrepareDeath(creature, killer)

	-- if not player, then die
	if not creature:isPlayer() then
		return true
	end

	-- if not level x, then die
	local player = Player(creature)
	if player:getLevel() ~= 100 then
		return true
	end

	-- add function player add life, mana and teleport to temple here
	local corpse = Game.createItem(player:getSex() == 0 and 3065 or 3058, 1, player:getPosition())
	corpse:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION,"You recognize ".. player:getName() ..". ".. (player:getSex() == 0 and "She" or "He") .." was killed by ".. killer:getName() ..".")
	corpse:decay()
	player:teleportTo(player:getTown():getTemplePosition())
	player:addHealth(player:getMaxHealth())
	player:addMana(player:getMaxMana())
	return false
end
creatureevent:register()
You can register this death on the website also using a database insert

The only thing is that there won't be that death message, just a teleport to the temple

Remember to register the event in login.lua
Lua:
player:registerEvent("levelDeath")

another way is using player.lua in events and the droploot.lua file in creaturescripts I believe
 
Last edited:
Back
Top