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

Solved function onKill

leandroluck

New Member
Joined
Dec 24, 2010
Messages
104
Reaction score
1
Code:
function onKill(creature, target)
    local targetMonster = target:getMonster()
    if not targetMonster or targetMonster:getName():lower() ~= 'boss1' then
        return true
    end
        Game.createMonster('boss2', Position(32800, 32831, 14))
    return true
end

<event type="kill" name="boss" script="quests/boss.lua" />
registerCreatureEvent(cid, "boss")

I have the following problem I would like when boss 1 dies boss 2 appears more is not working no error appears on the console
 
Solution
Check monster names. They should be writted the same as in its .xml
also comment this part:
Code:
--[[if not targetMonster or targetMonster:getName():lower() ~= 'boss1' then
        return true
    end]]
And check if the boss2 is created.
If so, the problem is in the code, if not, your problem is else where.

Also you should tell us the version you are using, its way easier to solve problems. (Guessing its 0.3-0.4)
Check monster names. They should be writted the same as in its .xml
also comment this part:
Code:
--[[if not targetMonster or targetMonster:getName():lower() ~= 'boss1' then
        return true
    end]]
And check if the boss2 is created.
If so, the problem is in the code, if not, your problem is else where.

Also you should tell us the version you are using, its way easier to solve problems. (Guessing its 0.3-0.4)
 
Solution
in theory was for him sumona but simply did nothing without error in the console.
is how the code was not running
otx
malucooo/Otxserver-Global

I put the function inside a file that was working and worked normally.
I'm forgetting something else, I do not know what
 
Last edited:
Back
Top