• 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 Script Boss Event TFS

Master Frank

Banned User
Joined
Nov 26, 2020
Messages
49
Reaction score
4
Problem With my Script
when kill boss no loot
Code:
local bosses = {
    ["The BOSS STRIKER"] = {
        {itemid = 9971, count = {min = 80, max = 100}},
        {itemid = 7440, count = {min = 1, max = 1}},
        {itemid = 12396, count = {min = 3, max = 10}},
        {itemid = 12575, count = {min = 3, max = 5}}
    }
}

function getRotate(uid)
    local pos = getCreaturePosition(uid)
    return
    {
        {x = pos.x, y = pos.y, z = pos.z},
        {x = pos.x, y = pos.y, z = pos.z},
        {x = pos.x, y = pos.y, z = pos.z},
        {x = pos.x, y = pos.y, z = pos.z},
        {x = pos.x, y = pos.y, z = pos.z}
    }
end

function onKill(cid, target)
    local bid = bosses[getCreatureName(target)]
    
    if isMonster(target) and bid and getStorage(33999) <= os.time() then
        doCreatureSetDropLoot(target, nil)
        for _, v in ipairs(bid) do
            setPlayerStorageValue(cid, 17000, getPlayerStorageValue(cid, 17000)+1)
            doSendMagicEffect(getRotate(target)[_], 6)
        end
        doSetStorage(33999, os.time() + 5)
    end

    return true
end

function onLogin(cid)
    return registerCreatureEvent(cid, "lootboss")
end
Lua:
function onTime(interval)
local config = {
pos = {x=164, y=50, z=6}, -- Posição aonde sera criado o teleport
topos = {x=250, y=150, z=7}, -- Posição pra onde o teleport ira levar o player
tpid = 1387, -- id do teleport
time = 3 -- tempo que o teleport ira sumir em minutos
}

function sendEffect()
    if (getGlobalStorageValue(16505) > 0) then
        doSendAnimatedText({x=164, y=50, z=6}, "BOSS", math.random(180))
        addEvent(sendEffect, 750)
    end
end

function DelTp()
local t = getTileItemById(config.pos, config.tpid)
if t then
doRemoveItem(t.uid, 1)
doSendMagicEffect(config.pos, CONST_ME_POFF)
end
end
doCreateTeleport(config.tpid, config.topos, config.pos)
doBroadcastMessage("O Event Boss foi aberto no templo e será fechado em 3 minutos")
setGlobalStorageValue(16505, 1)
addEvent(doCreateMonster, config.time*60*1000, "The BOSS STRIKER", {x=244, y=149, z=7})
addEvent(DelTp, config.time*60*1000)
addEvent(setGlobalStorageValue, config.time*60*1000, 16505, -1)
return true
end
 

Xikini

I whore myself out for likes
Support Team
Joined
Nov 17, 2010
Messages
5,625
Solutions
397
Reaction score
3,735
Line 26...
Lua:
doCreatureSetDropLoot(target, nil)
You're setting the boss loot to nil.
 
OP
OP
M

Master Frank

Banned User
Joined
Nov 26, 2020
Messages
49
Reaction score
4
i remove /but when i kill nothing
Lua:
local bosses = {
    ["The BOSS STRIKER"] = {
        {itemid = 9971, count = {min = 80, max = 100}},
        {itemid = 7440, count = {min = 1, max = 1}},
        {itemid = 12396, count = {min = 3, max = 10}},
        {itemid = 12575, count = {min = 3, max = 5}}
    }
}

function getRotate(uid)
    local pos = getCreaturePosition(uid)
    return
    {
        {x = pos.x, y = pos.y, z = pos.z},
        {x = pos.x, y = pos.y, z = pos.z},
        {x = pos.x, y = pos.y, z = pos.z},
        {x = pos.x, y = pos.y, z = pos.z},
        {x = pos.x, y = pos.y, z = pos.z}
    }
end

function onKill(cid, target)
    local bid = bosses[getCreatureName(target)]
    
    if isMonster(target) and bid and getStorage(33999) <= os.time() then
                for _, v in ipairs(bid) do
            setPlayerStorageValue(cid, 17000, getPlayerStorageValue(cid, 17000)+1)
            doSendMagicEffect(getRotate(target)[_], 6)
        end
        doSetStorage(33999, os.time() + 5)
    end

    return true
end

function onLogin(cid)
    return registerCreatureEvent(cid, "lootboss")
end
 
Top