Ir para conteúdo

Featured Replies

Postado

Bom dia estou com os seguintes problemas
ja vasculhei todo o TK e nao achei a solução...
quando o player morre o
Amulet Of Loss
aparece o seguinte erro

ja tentei varias coisas...
 

Lua Script Error: [CreatureScript Interface] 
data/creaturescripts/scripts/others/droploot.lua:onDeath 
data/creaturescripts/scripts/others/droploot.lua:2: attempt to call global 'getPlayerFlagValue' (a nil value) 
stack traceback: 
[C]: in function 'getPlayerFlagValue' 
data/creaturescripts/scripts/others/droploot.lua:2: in function 


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
O outro problema e bless...
ela simplesmente nao protege em nada o player morre e perde skill xp etc:

Por favor galera me ajudem.

 

droploot.lua

Postado

Que versão tfs?

O problema é aqui: if getPlayerFlagValue(player, PlayerFlag_NotGenerateLoot)

 

Isso é 1.0? Infelizmente se for não vou poder te ajudar

 

@This life is filled with hurt

When happiness doesn't work

Trust me and take my hand

When the lights go out you will understand

Postado
  • Autor
1 hora atrás, login12 disse:

Que versão tfs?

O problema é aqui: if getPlayerFlagValue(player, PlayerFlag_NotGenerateLoot)

 

Isso é 1.0? Infelizmente se for não vou poder te ajudar

sim lek neste exato momento acabei de resolver este problema

muito obrigado

quem estiver com este problema esta e a lua que estou usando solucionada

 

data/creaturescripts/scripts/others/droploot.lua

function onDeath(player, corpse, killer, mostDamage, unjustified, mostDamage_unjustified)
	
player:removeItem(ITEM_AMULETOFLOSS, 1, -1, false)

if 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 isInArray({SKULL_RED, SKULL_BLACK}, player:getSkull()) then
		local isPlayer = true
		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 isInArray({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 Matheus Junior
corrigindo (veja o histórico de edições)

Postado
8 minutos atrás, Matheus Junior disse:

sim lek neste exato momento acabei de resolver este problema

muito obrigado

quem estiver com este problema esta e a lua que estou usando solucionada

 

data/creaturescripts/scripts/others/droploot.lua


function onDeath(player, corpse, killer, mostDamage, unjustified, mostDamage_unjustified)
	
player:removeItem(ITEM_AMULETOFLOSS, 1, -1, false)

if 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 isInArray({SKULL_RED, SKULL_BLACK}, player:getSkull()) then
		local isPlayer = true
		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 isInArray({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

 

Eu não fiz nada kkkkkk só apontei o erro.

Que bom que resolveu! Boa sorte

 

@This life is filled with hurt

When happiness doesn't work

Trust me and take my hand

When the lights go out you will understand

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