• 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 Creature Script

nefinoo

Carnage.flv
Joined
Sep 11, 2010
Messages
549
Solutions
1
Reaction score
58
Location
Lo Mochis, Sinaloa
Someone could help me with a script so that when a monster is killed, it immediately adds another, as if it were about reviving the same monster but now with more life or with a different looktype. I am using tfs 1.3
 
Try this, Not tested
Lua:
function onKill(player, target)
        local hp = 5000
    local targetMonster = target:getMonster()
    if not targetMonster then
        return true
    end
        bossName = targetMonster:getName():lower() == 'BOSSNAME HERE'

    if not bossName then
        return true
    end
    Game.createMonster(bossName, targetMonster:getPosition(), false, true)
        bossName:setMaxHealth(hp)
        bossName:addHealth(hp - monster:getHealth())
        bossName:setOutfit(Outfitnumberhere)
    return true
end
 
Just place all of this into a lua file into data/monster/
Lua:
local creatureevent = CreatureEvent("xxx") -- *1

function creatureevent.onDeath(creature, corpse, killer, mostDamageKiller, lastHitUnjustified, mostDamageUnjustified)
    Game.createMonster("MonsterName", creature:getPosition(), false, true)
    return true
end

creatureevent:register()

local mType = MonsterType("MonsterName") -- name of the monster which dies in this case to summon the next.
mType:registerEvent("xxx") -- xxx has to be the same as you put into *1
 
Back
Top