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

Auto loot (Loot Pounch)

Elieder2024

New Member
Joined
Jan 13, 2024
Messages
1
Reaction score
0
GitHub
Canary
Ola estou procurando script para meu tfs Canary, o script seria quando player obter o Gold Pouch , ele tem o privilégio do autoloot.

Desde já agradeço a atenção
 
Ola estou procurando script para meu tfs Canary, o script seria quando player obter o Gold Pouch , ele tem o privilégio do autoloot.

Desde já agradeço a atenção
It has not been tested here it is, Canary - Version 3.1.2.

LUA:
local feature = TalkAction("!autoloot")

local validValues = {
    -- "all",
    "on",
    "off",
}

function feature.onSay(player, words, param)
    -- Checks if the AutoLoot system is active
    if not configManager.getBoolean(configKeys.AUTOLOOT) then
        return true
    end

    -- Checks if the player needs to be a VIP
    if configManager.getBoolean(configKeys.VIP_SYSTEM_ENABLED) and configManager.getBoolean(configKeys.VIP_AUTOLOOT_VIP_ONLY) and not player:isVip() then
        player:sendCancelMessage("You need to be VIP to use this command!")
        return true
    end

    -- Checks if the player has item ID 1832 in the GameStore slot (CONST_SLOT_STORE_INBOX)
    local requiredItemId = 1832
    local storeItem = player:getSlotItem(CONST_SLOT_STORE_INBOX)

    if not storeItem or storeItem.itemid ~= requiredItemId then
        player:sendCancelMessage("You need to have the required GameStore item equipped to use this command!")
        return true
    end

    -- Checks if the parameter is valid
    if not table.contains(validValues, param) then
        local validValuesStr = table.concat(validValues, "/")
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Invalid param specified. Usage: !autoloot [" .. validValuesStr .. "]")
        return true
    end

    -- Sets AutoLoot based on parameter
    if param == "all" then
        player:setFeature(Features.AutoLoot, 2)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "AutoLoot is now enabled for all kills (including bosses).")
    elseif param == "on" then
        player:setFeature(Features.AutoLoot, 1)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "AutoLoot is now enabled for all regular kills (no bosses).")
    elseif param == "off" then
        player:setFeature(Features.AutoLoot, 0)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "AutoLoot is now disabled.")
    end
    return true
end

feature:separator(" ")
feature:groupType("normal")
feature:register()
 
Back
Top