• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Spawn monster on player death

Candlejack

Don't hug me I'm scared
Joined
Jun 20, 2012
Messages
87
Reaction score
39
Location
nowhere
Is it possible to make a monster spawn when a player dies?
Like the monster spawn in place of the dead player, sort of like a zombie or something.
 
The code from Ninja thread:

Code:
function onDeath(cid, corpse, lasthitkiller, mostdamagekiller, lasthitunjustified, mostdamageunjustified)
local player = Player(cid)
local item = Item(corpse)
if player:getLevel() <= 10 then
addEvent(function () doSummonCreature("Skeleton", item:getPosition()) item:remove() end, 30000)
else
addEvent(function () doSummonCreature("Demon Skeleton", item:getPosition()) item:remove() end, 30000)
end
return true
end

In this case summon one skeleton or one Demon skeleton depends on this condition "playerLevel"
 
Back
Top