Ir para conteúdo
  • Cadastre-se

(Resolvido)Dar Look, gera Erro!


Ir para solução Resolvido por Deadpool,

Posts Recomendados

Gente eu adicionei um novo pokemon no meu server, o Big Magikarp mas quando eu vou dar Look no Corpse dele não apareçe nada e gera erro no console, veja o erro:

[Error - CreatureScript Interface] 
data/creaturescripts/scripts/look.lua:onLook
Description: 
data/creaturescripts/scripts/look.lua:54: attempt to concatenate a nil value
stack traceback:
	data/creaturescripts/scripts/look.lua:54: in function <data/creaturescripts/scripts/look.lua:1>

Aqui está o arquivo citado no erro, o look.lua

function onLook(cid, thing, position, lookDistance)

	local str = ""

	if not isCreature(thing.uid) then

		local iname = getItemInfo(thing.itemid)

		if isPokeball(thing.itemid) then

			local owner = getItemAttribute(thing.uid, "firstpoke")

			local pokename = getItemAttribute(thing.uid, "poke")
			local item = getItemInfo(thing.itemid)
			str = "You see "..item.article.." "..item.name..".\n"
			str = str.."It contains "..getArticle(pokename).." "..pokename.." [level "..getItemAttribute(thing.uid, "level").."].\n"

			if owner and owner ~= getCreatureName(cid) then
				str = str.."It belongs to "..owner..".\nIt is a unique item."
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
			return false
			end

			local boost = getItemAttribute(thing.uid, "boost") or 0
			local boostshow = ""

			if boost > 0 then
				str = str.."Boost level: +"..boost..".\n"
			end

			if getItemAttribute(thing.uid, "nick") then
				str = str.."It's nickname is: "..getItemAttribute(thing.uid, "nick")..".\n"
			end
		
			if getItemAttribute(thing.uid, "gender") == SEX_MALE then
				str = str.."It is male."
			elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then
				str = str.."It is female."
			else
				str = str.."It is genderless."
			end
	
			str = str.."\n--- Status ---"
			str = str.."\nOffense: "..math.floor(getItemAttribute(thing.uid, "offense")).." Defense: "..math.floor(getItemAttribute(thing.uid, "defense")).."\n"
			str = str.."Agility: "..math.floor(getItemAttribute(thing.uid, "speed")).." Sp. Attack: "..math.floor(getItemAttribute(thing.uid, "specialattack")).."\n"
			str = str.."Vitality: "..math.floor(getItemAttribute(thing.uid, "vitality"))..""	

		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)

		return false

		elseif string.find(iname.name, "fainted") or string.find(iname.name, "defeated") then

			str = "You see a "..string.lower(iname.name).." ["..getItemAttribute(thing.uid, "level").."].\n"

			if getItemAttribute(thing.uid, "gender") == SEX_MALE then
				str = str.."It is male."
			elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then
				str = str.."It is female."
			else
				str = str.."It is genderless."
			end
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)

		return false

		else

		return true

		end
	end

	local npcname = getCreatureName(thing.uid)
	local l = string.len(npcname)
		if not isPlayer(thing.uid) and not isMonster(thing.uid) then
			--string.sub(npcname, l - 1, l) == "  " then
			local article = getPlayerStorageValue(thing.uid, 9891) == 1 and "He is" or "She is"
			local nname = string.sub(npcname, 1, l - 2)
			if nname == getCreatureName(cid) then
				nname = "yourself"
				article = "You are"
			end
			str = "You see "..nname..". "..article.." a pokemon trainer."
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
		return false
		end

	if not isMonster(thing.uid) then
	return true
	end

	if getCreatureName(thing.uid) == "Evolution" then return false end

	if not isSummon(thing.uid) then
		local str = "You see a wild "..string.lower(getCreatureName(thing.uid)).." [level "..getPokemonLevel(thing.uid).."].\n"
		if getPokemonGender(thing.uid)  == SEX_MALE then
			str = str.."It is male."
		elseif getPokemonGender(thing.uid)  == SEX_FEMALE then
			str = str.."It is female."
		else
			str = str.."It is genderless."
		end
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
	return false
	elseif isSummon(thing.uid) and not isPlayer(thing.uid) then

		local boostlevel = getItemAttribute(getPlayerSlotItem(getCreatureMaster(thing.uid), 8).uid, "boost") or 0
		local boostshow = " + "..boostlevel.."]"

		if showBoostSeparated then
			boostshow = "] [+"..boostlevel.."]"
		end

		local levelinfo = "["..getPokemonLevel(thing.uid)..""..boostshow..""

		if getCreatureMaster(thing.uid) == cid then
			local myball = getPlayerSlotItem(cid, 8).uid
			local nexp = getItemAttribute(myball, "nextlevelexp")

			local string = "You see your "..string.lower(getCreatureName(thing.uid)).." "..levelinfo.."."
			string = string.."\nHit points: "..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid).."."
			string = string.."\n"..getPokemonHappinessDescription(thing.uid)
				if getItemAttribute(myball, "level") <= 999999999 then
					string = string.."\nExperience needed to level up: "..nexp.."."
				end
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, string)
		else
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..string.lower(getCreatureName(thing.uid)).." "..levelinfo..".\nIt belongs to "..getCreatureName(getCreatureMaster(thing.uid))..".")
		end


	return false
	end

return true
end

 

Nota: O meu server tem Level System!

 

OBRIGADO POR ME AJUDAR!

REP+ PARA TODOS QUE TENTAREM! :D


 

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

Meus Contatos!

 

Minhas Funções:

 

               Skype: TsplayerT

         Facebook: TakaFukushii

          YouTube: ADoseDupla

           Twitter: @_Splayer_

 

 

 

 

 

 

 

                             Mapper:▓▓▓▓▓▓▓▓▓▓ 97%

     Programmer:▓▓▓▓▓▒▒▒▒▒ 45%

             Scripter:▓▓▓▓▓▓▓▓▓▒ 83%

              Spriter:▓▓▓▓▓▓▒▒▒▒ 57%

    Gamemaster:▓▓▓▓▓▓▓▓▓▓ 99%

        Ot Creator:▓▓▓▓▓▓▓▒▒▒71%

Ot Client Maker:▓▓▓▓▓▓▓▒▒▒74%

 

Link para o post
Compartilhar em outros sites
  • Solução

Tenta:

function onLook(cid, thing, position, lookDistance)

	local str = ""

	if not isCreature(thing.uid) then

		local iname = getItemInfo(thing.itemid)

		if isPokeball(thing.itemid) then

			local owner = getItemAttribute(thing.uid, "firstpoke")

			local pokename = getItemAttribute(thing.uid, "poke")
			local item = getItemInfo(thing.itemid)
			str = "You see "..item.article.." "..item.name..".\n"
			str = str.."It contains "..getArticle(pokename).." "..pokename.." [level "..getItemAttribute(thing.uid, "level").."].\n"

			if owner and owner ~= getCreatureName(cid) then
				str = str.."It belongs to "..owner..".\nIt is a unique item."
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
			return false
			end

			local boost = getItemAttribute(thing.uid, "boost") or 0
			local boostshow = ""

			if boost > 0 then
				str = str.."Boost level: +"..boost..".\n"
			end

			if getItemAttribute(thing.uid, "nick") then
				str = str.."It's nickname is: "..getItemAttribute(thing.uid, "nick")..".\n"
			end
		
			if getItemAttribute(thing.uid, "gender") == SEX_MALE then
				str = str.."It is male."
			elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then
				str = str.."It is female."
			else
				str = str.."It is genderless."
			end
	
			str = str.."\n--- Status ---"
			str = str.."\nOffense: "..math.floor(getItemAttribute(thing.uid, "offense")).." Defense: "..math.floor(getItemAttribute(thing.uid, "defense")).."\n"
			str = str.."Agility: "..math.floor(getItemAttribute(thing.uid, "speed")).." Sp. Attack: "..math.floor(getItemAttribute(thing.uid, "specialattack")).."\n"
			str = str.."Vitality: "..math.floor(getItemAttribute(thing.uid, "vitality"))..""	

		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)

		return false

		elseif string.find(iname.name, "fainted") or string.find(iname.name, "defeated") then

			str = "You see a "..string.lower(iname.name)..".\n"

			if getItemAttribute(thing.uid, "gender") == SEX_MALE then
				str = str.."It is male."
			elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then
				str = str.."It is female."
			else
				str = str.."It is genderless."
			end
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)

		return false

		else

		return true

		end
	end

	local npcname = getCreatureName(thing.uid)
	local l = string.len(npcname)
		if not isPlayer(thing.uid) and not isMonster(thing.uid) then
			--string.sub(npcname, l - 1, l) == "  " then
			local article = getPlayerStorageValue(thing.uid, 9891) == 1 and "He is" or "She is"
			local nname = string.sub(npcname, 1, l - 2)
			if nname == getCreatureName(cid) then
				nname = "yourself"
				article = "You are"
			end
			str = "You see "..nname..". "..article.." a pokemon trainer."
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
		return false
		end

	if not isMonster(thing.uid) then
	return true
	end

	if getCreatureName(thing.uid) == "Evolution" then return false end

	if not isSummon(thing.uid) then
		local str = "You see a wild "..string.lower(getCreatureName(thing.uid)).." [level "..getPokemonLevel(thing.uid).."].\n"
		if getPokemonGender(thing.uid)  == SEX_MALE then
			str = str.."It is male."
		elseif getPokemonGender(thing.uid)  == SEX_FEMALE then
			str = str.."It is female."
		else
			str = str.."It is genderless."
		end
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
	return false
	elseif isSummon(thing.uid) and not isPlayer(thing.uid) then

		local boostlevel = getItemAttribute(getPlayerSlotItem(getCreatureMaster(thing.uid), 8).uid, "boost") or 0
		local boostshow = " + "..boostlevel.."]"

		if showBoostSeparated then
			boostshow = "] [+"..boostlevel.."]"
		end

		local levelinfo = "["..getPokemonLevel(thing.uid)..""..boostshow..""

		if getCreatureMaster(thing.uid) == cid then
			local myball = getPlayerSlotItem(cid, 8).uid
			local nexp = getItemAttribute(myball, "nextlevelexp")

			local string = "You see your "..string.lower(getCreatureName(thing.uid)).." "..levelinfo.."."
			string = string.."\nHit points: "..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid).."."
			string = string.."\n"..getPokemonHappinessDescription(thing.uid)
				if getItemAttribute(myball, "level") <= 999999999 then
					string = string.."\nExperience needed to level up: "..nexp.."."
				end
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, string)
		else
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..string.lower(getCreatureName(thing.uid)).." "..levelinfo..".\nIt belongs to "..getCreatureName(getCreatureMaster(thing.uid))..".")
		end


	return false
	end

return true
end

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

Se te ajudei, deixe seu curti, clique em melhor resposta, para que eu possa ajudar sempre.

 

skype.png

Trabalhos (C++):

Cor das mensagens nos channels

Ajusta/Mudar cor das mensagens de Loot

Liberação dos novos Remakes da PokeXGames.

NPC "Guild Master" que cria, deleta, invita, kicka players da guild.

 

 B4OBUkH.png At Soon, LIKE ON FACEBOOK. Clik on Imgs

Link para o post
Compartilhar em outros sites

Tenta:

function onLook(cid, thing, position, lookDistance)

	local str = ""

	if not isCreature(thing.uid) then

		local iname = getItemInfo(thing.itemid)

		if isPokeball(thing.itemid) then

			local owner = getItemAttribute(thing.uid, "firstpoke")

			local pokename = getItemAttribute(thing.uid, "poke")
			local item = getItemInfo(thing.itemid)
			str = "You see "..item.article.." "..item.name..".\n"
			str = str.."It contains "..getArticle(pokename).." "..pokename.." [level "..getItemAttribute(thing.uid, "level").."].\n"

			if owner and owner ~= getCreatureName(cid) then
				str = str.."It belongs to "..owner..".\nIt is a unique item."
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
			return false
			end

			local boost = getItemAttribute(thing.uid, "boost") or 0
			local boostshow = ""

			if boost > 0 then
				str = str.."Boost level: +"..boost..".\n"
			end

			if getItemAttribute(thing.uid, "nick") then
				str = str.."It's nickname is: "..getItemAttribute(thing.uid, "nick")..".\n"
			end
		
			if getItemAttribute(thing.uid, "gender") == SEX_MALE then
				str = str.."It is male."
			elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then
				str = str.."It is female."
			else
				str = str.."It is genderless."
			end
	
			str = str.."\n--- Status ---"
			str = str.."\nOffense: "..math.floor(getItemAttribute(thing.uid, "offense")).." Defense: "..math.floor(getItemAttribute(thing.uid, "defense")).."\n"
			str = str.."Agility: "..math.floor(getItemAttribute(thing.uid, "speed")).." Sp. Attack: "..math.floor(getItemAttribute(thing.uid, "specialattack")).."\n"
			str = str.."Vitality: "..math.floor(getItemAttribute(thing.uid, "vitality"))..""	

		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)

		return false

		elseif string.find(iname.name, "fainted") or string.find(iname.name, "defeated") then

			str = "You see a "..string.lower(iname.name)..".\n"

			if getItemAttribute(thing.uid, "gender") == SEX_MALE then
				str = str.."It is male."
			elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then
				str = str.."It is female."
			else
				str = str.."It is genderless."
			end
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)

		return false

		else

		return true

		end
	end

	local npcname = getCreatureName(thing.uid)
	local l = string.len(npcname)
		if not isPlayer(thing.uid) and not isMonster(thing.uid) then
			--string.sub(npcname, l - 1, l) == "  " then
			local article = getPlayerStorageValue(thing.uid, 9891) == 1 and "He is" or "She is"
			local nname = string.sub(npcname, 1, l - 2)
			if nname == getCreatureName(cid) then
				nname = "yourself"
				article = "You are"
			end
			str = "You see "..nname..". "..article.." a pokemon trainer."
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
		return false
		end

	if not isMonster(thing.uid) then
	return true
	end

	if getCreatureName(thing.uid) == "Evolution" then return false end

	if not isSummon(thing.uid) then
		local str = "You see a wild "..string.lower(getCreatureName(thing.uid)).." [level "..getPokemonLevel(thing.uid).."].\n"
		if getPokemonGender(thing.uid)  == SEX_MALE then
			str = str.."It is male."
		elseif getPokemonGender(thing.uid)  == SEX_FEMALE then
			str = str.."It is female."
		else
			str = str.."It is genderless."
		end
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
	return false
	elseif isSummon(thing.uid) and not isPlayer(thing.uid) then

		local boostlevel = getItemAttribute(getPlayerSlotItem(getCreatureMaster(thing.uid), 8).uid, "boost") or 0
		local boostshow = " + "..boostlevel.."]"

		if showBoostSeparated then
			boostshow = "] [+"..boostlevel.."]"
		end

		local levelinfo = "["..getPokemonLevel(thing.uid)..""..boostshow..""

		if getCreatureMaster(thing.uid) == cid then
			local myball = getPlayerSlotItem(cid, 8).uid
			local nexp = getItemAttribute(myball, "nextlevelexp")

			local string = "You see your "..string.lower(getCreatureName(thing.uid)).." "..levelinfo.."."
			string = string.."\nHit points: "..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid).."."
			string = string.."\n"..getPokemonHappinessDescription(thing.uid)
				if getItemAttribute(myball, "level") <= 999999999 then
					string = string.."\nExperience needed to level up: "..nexp.."."
				end
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, string)
		else
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..string.lower(getCreatureName(thing.uid)).." "..levelinfo..".\nIt belongs to "..getCreatureName(getCreatureMaster(thing.uid))..".")
		end


	return false
	end

return true
end

Funcionou Perfeito, mas ele demora um pouco, tipo eu mato o pokemon ( server congela/para)e depois de alguns segundos volta ai apareçe o corpo no lugar do pokemon. Apareçe muitos erros iguais, olhe:

[Error - CreatureScript Interface] 
data/creaturescripts/scripts/pokeexp.lua:onDeath
Description: 
(luaGetItemAttribute) Item not found

Meus Contatos!

 

Minhas Funções:

 

               Skype: TsplayerT

         Facebook: TakaFukushii

          YouTube: ADoseDupla

           Twitter: @_Splayer_

 

 

 

 

 

 

 

                             Mapper:▓▓▓▓▓▓▓▓▓▓ 97%

     Programmer:▓▓▓▓▓▒▒▒▒▒ 45%

             Scripter:▓▓▓▓▓▓▓▓▓▒ 83%

              Spriter:▓▓▓▓▓▓▒▒▒▒ 57%

    Gamemaster:▓▓▓▓▓▓▓▓▓▓ 99%

        Ot Creator:▓▓▓▓▓▓▓▒▒▒71%

Ot Client Maker:▓▓▓▓▓▓▓▒▒▒74%

 

Link para o post
Compartilhar em outros sites

Você adicionou no serve o ITEM(corpse)? pq parece que você não configurou certo.. kkk Alias, me contate no facebook, pra gente conversa!

Se te ajudei, deixe seu curti, clique em melhor resposta, para que eu possa ajudar sempre.

 

skype.png

Trabalhos (C++):

Cor das mensagens nos channels

Ajusta/Mudar cor das mensagens de Loot

Liberação dos novos Remakes da PokeXGames.

NPC "Guild Master" que cria, deleta, invita, kicka players da guild.

 

 B4OBUkH.png At Soon, LIKE ON FACEBOOK. Clik on Imgs

Link para o post
Compartilhar em outros sites

Você adicionou no serve o ITEM(corpse)? pq parece que você não configurou certo.. kkk Alias, me contate no facebook, pra gente conversa!

Eu adicionei no Items.xml e agora o Look está funcionando mas demora para apareçer o corpse. Ok Adicionando!

Meus Contatos!

 

Minhas Funções:

 

               Skype: TsplayerT

         Facebook: TakaFukushii

          YouTube: ADoseDupla

           Twitter: @_Splayer_

 

 

 

 

 

 

 

                             Mapper:▓▓▓▓▓▓▓▓▓▓ 97%

     Programmer:▓▓▓▓▓▒▒▒▒▒ 45%

             Scripter:▓▓▓▓▓▓▓▓▓▒ 83%

              Spriter:▓▓▓▓▓▓▒▒▒▒ 57%

    Gamemaster:▓▓▓▓▓▓▓▓▓▓ 99%

        Ot Creator:▓▓▓▓▓▓▓▒▒▒71%

Ot Client Maker:▓▓▓▓▓▓▓▒▒▒74%

 

Link para o post
Compartilhar em outros sites

configurou no xml do poke e no configuratio.lua?

Se te ajudei, deixe seu curti, clique em melhor resposta, para que eu possa ajudar sempre.

 

skype.png

Trabalhos (C++):

Cor das mensagens nos channels

Ajusta/Mudar cor das mensagens de Loot

Liberação dos novos Remakes da PokeXGames.

NPC "Guild Master" que cria, deleta, invita, kicka players da guild.

 

 B4OBUkH.png At Soon, LIKE ON FACEBOOK. Clik on Imgs

Link para o post
Compartilhar em outros sites

configurou no xml do poke e no configuratio.lua?

Ja arrumei!

Meus Contatos!

 

Minhas Funções:

 

               Skype: TsplayerT

         Facebook: TakaFukushii

          YouTube: ADoseDupla

           Twitter: @_Splayer_

 

 

 

 

 

 

 

                             Mapper:▓▓▓▓▓▓▓▓▓▓ 97%

     Programmer:▓▓▓▓▓▒▒▒▒▒ 45%

             Scripter:▓▓▓▓▓▓▓▓▓▒ 83%

              Spriter:▓▓▓▓▓▓▒▒▒▒ 57%

    Gamemaster:▓▓▓▓▓▓▓▓▓▓ 99%

        Ot Creator:▓▓▓▓▓▓▓▒▒▒71%

Ot Client Maker:▓▓▓▓▓▓▓▒▒▒74%

 

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.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo