Ir para conteúdo

Featured Replies

  • Respostas 80
  • Visualizações 30.4k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • luanluciano93
    luanluciano93

    Aguardando dicas ...   Opa, o projeto é open no github, toda ajuda é bem vinda.   Tem vários tópicos aqui no fórum de como rodar um servidor tfs 1.x .. basta seguir a dicas e u

  • luanluciano93
    luanluciano93

    Atualizacao 17-09-2017 Atualizacao TFS rev 2524 Corrigido erro na alavancas (levers.lua)

  • luanluciano93
    luanluciano93

    Update 08-09-17 • Atualizado TFS 2516 • Adicionado Zumbi Event • Adicionado alavancas inteligentes • Corrigido erro no Battlefield Evento e Duca Evento (movements) • Reajustado o arquivo compat.

Posted Images

Postado
Em 07/02/2018 em 17:12, luanluciano93 disse:

Eu copilei ele tudo certo só que quando vou usar o theforgottenserver e meu personagem morre da esse erro. observaçao usando tua distro funciona normal

Spoiler

erro.png?width=400&height=99

meu droploot.lua

Spoiler

function onDeath(player, corpse, killer, mostDamage, unjustified, mostDamage_unjustified)
    if getPlayerFlagValue(player, PlayerFlag_NotGenerateLoot) or player:getVocation():getId() == VOCATION_NONE then
        return true
    end

    local amulet = player:getSlotItem(CONST_SLOT_NECKLACE)
    if amulet and amulet.itemid == ITEM_AMULETOFLOSS and not table.contains({SKULL_RED, SKULL_BLACK}, player:getSkull()) then
        local isPlayer = false
        if killer then
            if killer:isPlayer() then
                isPlayer = true
            else
                local master = killer:getMaster()
                if master and master:isPlayer() then
                    isPlayer = true
                end
            end
        end

        if not isPlayer or not player:hasBlessing(6) then
            player:removeItem(ITEM_AMULETOFLOSS, 1, -1, false)
        end
    else
        for i = CONST_SLOT_HEAD, CONST_SLOT_AMMO do
            local item = player:getSlotItem(i)
            if item then
                if table.contains({SKULL_RED, SKULL_BLACK}, player:getSkull()) or math.random(item:isContainer() and 100 or 1000) <= player:getLossPercent() then
                    if not item:moveTo(corpse) then
                        item:remove()
                    end
                end
            end
        end
    end

    if not player:getSlotItem(CONST_SLOT_BACKPACK) then
        player:addItem(ITEM_BAG, 1, false, CONST_SLOT_BACKPACK)
    end
    return true
end
 

 

Editado por pachecomaromba
up (veja o histórico de edições)

  • 2 weeks later...
Postado
  • Autor

@pachecomaromba em todos os lugares que tiver essa função: getPlayerFlagValue(cid, flag) troque por: player:hasFlag(flag)

 

@xWhiteWolf sobre o browse field, realmente, em events tem uma função que resolve isso, a minha ficou assim: 

function Player:onBrowseField(position)
	local tile = Tile(position)
	if not tile then
		return false
	end

	local tileItems = tile:getItems()
	for k, item in ipairs(tileItems) do
		if table.contains({8046, 8047}, item:getId()) and k < #tileItems then
			return false
		end
	end

	return true
end

Obrigado pela ajuda.

Editado por luanluciano93 (veja o histórico de edições)

Postado
9 hours ago, luanluciano93 said:

@pachecomaromba em todos os lugares que tiver essa função: getPlayerFlagValue(cid, flag) troque por: player:hasFlag(flag)

 

@xWhiteWolf sobre o browse field, realmente, em events tem uma função que resolve isso, a minha ficou assim: 


function Player:onBrowseField(position)
	local tile = Tile(position)
	if not tile then
		return false
	end

	local tileItems = tile:getItems()
	for k, item in ipairs(tileItems) do
		if table.contains({8046, 8047}, item:getId()) and k < #tileItems then
			return false
		end
	end

	return true
end

Obrigado pela ajuda.

 

que isso po, só assoprei uma dica. Você que fez tudo :3

 

Todos os meus trabalhos importantes estão na seção "Sobre mim" no meu perfil; Dá uma passada lá!

"Há três caminhos para o fracasso: não ensinar o que se sabe, não praticar o que se ensina, e não perguntar o que se ignora." - São Beda

I7Pm6ih.png

(obg ao @Beeny por fazer essa linda sign <3)

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

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo