piso que sumonar monstro

Xtibianoo01
em Scripts

Xtibianoo01

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 23/08/18Posts: 48

colocar esse piso para ficar sumonando monstro por 4 minutos , depois desse tempo sumonaria um boss. (tfs 0.3.6)

 

local monster = {"demon", {x = 1, y = 1, z = 1}}

local timetoremove = {2, "min"}

 

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)

    if getCreatureByName(monster[1]) then return true end

    local m = doCreateMonster(monster[1], monster[2])

    addEvent(function() if isMonster(m) then doRemoveCreature(m) end end, mathtime(timetoremove) * 1000)

    return true

end

 

function mathtime(table) -- by dwarfer

local unit = {"sec", "min", "hour", "day"}

for i, v in pairs(unit) do

if v == table[2] then

return table[1](60^(v == unit[4] and 2 or i-1))(v == unit[4] and 24 or 1)

end

end

return error("Bad declaration in mathtime function.")

end