• 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.3](Creaturescripts) onKill: When one boss died next one will appear after 1h.

Lay

TFS 1.2
Joined
Dec 7, 2012
Messages
67
Solutions
9
Reaction score
29
Hey,
I tried but. . . arrrrr
Need something looks like:
Lua:
local respawnTime = 60 * 60 * 1000

local config = {
    ['test1'] = {position = Position(1000, 1000, 7), monster = 'test2'},
    ['test2'] = {position = Position(1000, 1000, 7), monster = 'test3'},
    ['test3'] = {position = Position(1000, 1000, 7), monster = 'test1'}
}

If player killd 'test1' he need wait an hour to respawn next 'test2' then the same with 'test3'.
Thanks.
 
Solution
Code:
local config = {
    ['test1'] = {position = Position(1000, 1000, 7), monster = 'test2'},
    ['test2'] = {position = Position(1000, 1000, 7), monster = 'test3'},
    ['test3'] = {position = Position(1000, 1000, 7), monster = 'test1'}
}

function onKill(creature, target)
       INFO = config[target:getName()]
        if not INFO then return true end
    addEvent(spawnBoss, 60 * 60 * 1000, INFO)
return true
end

function spawnBoss(INFO)
    if INFO then
        Game.createMonster(INFO.monster, INFO.position)
    end
end
Lua:
local config = {
    ['test1'] = {position = Position(1000, 1000, 7), monster = 'test2'},
    ['test2'] = {position = Position(1000, 1000, 7), monster = 'test3'},
    ['test3'] = {position =...
Code:
local config = {
    ['test1'] = {position = Position(1000, 1000, 7), monster = 'test2'},
    ['test2'] = {position = Position(1000, 1000, 7), monster = 'test3'},
    ['test3'] = {position = Position(1000, 1000, 7), monster = 'test1'}
}

function onKill(creature, target)
       INFO = config[target:getName()]
        if not INFO then return true end
    addEvent(spawnBoss, 60 * 60 * 1000, INFO)
return true
end

function spawnBoss(INFO)
    if INFO then
        Game.createMonster(INFO.monster, INFO.position)
    end
end
 
Code:
local config = {
    ['test1'] = {position = Position(1000, 1000, 7), monster = 'test2'},
    ['test2'] = {position = Position(1000, 1000, 7), monster = 'test3'},
    ['test3'] = {position = Position(1000, 1000, 7), monster = 'test1'}
}

function onKill(creature, target)
       INFO = config[target:getName()]
        if not INFO then return true end
    addEvent(spawnBoss, 60 * 60 * 1000, INFO)
return true
end

function spawnBoss(INFO)
    if INFO then
        Game.createMonster(INFO.monster, INFO.position)
    end
end
Lua:
local config = {
    ['test1'] = {position = Position(1000, 1000, 7), monster = 'test2'},
    ['test2'] = {position = Position(1000, 1000, 7), monster = 'test3'},
    ['test3'] = {position = Position(1000, 1000, 7), monster = 'test1'}
}

function onKill(creature, target)
    info = config[target:getName()]
    if not info then
        return true
    end
    addEvent(Game.createMonster, 60 * 60 * 1000, info.monster, info.position)
    return true
end
you can use Game.createMonster itself rather than creating a new function which does the same thing
 
Solution
Back
Top