Ir para conteúdo

Featured Replies

Postado

Boa galera to com um erro preciso de ajuda. TFS 0.4

 

 

Este erro

  Citar

[4:44:08.914] [Error - Action Interface]
[4:44:08.917] data/actions/scripts/other/cave_action.lua:onUse
[4:44:08.921] Description:
[4:44:08.923] data/actions/scripts/other/cave_action.lua:8: attempt to index fie
ld '?' (a nil value)
[4:44:08.929] stack traceback:
[4:44:08.931]   data/actions/scripts/other/cave_action.lua:8: in function <data/
actions/scripts/other/cave_action.lua:1>

 

código

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if itemEx.itemid == caveExclusiva.config.buyItemID then
		if getPlayerStorageValue(cid, caveExclusiva.storages.cave) > 0 then
			local caveName = caveExclusiva.caves[getPlayerStorageValue(cid, caveExclusiva.storages.cave)].caveName
			local timeLeft = getPlayerStorageValue(cid, caveExclusiva.storages.time) - os.time()
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você já é dono da cave de ".. caveName ..", aguarde ".. getTimeString(timeLeft) .." para comprar uma cave novamente.")
			doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
		elseif getGlobalStorageValue(caveExclusiva.caves[itemEx.aid].gStor) > 1 then
			local ownerGUID = getGlobalStorageValue(caveExclusiva.caves[itemEx.aid].gStor)
			local ownerTimeLeft = nil
			if isPlayerOnline(getPlayerNameByGUID(ownerGUID)) then
				ownerTimeLeft = getPlayerStorageValue(getPlayerByGUID(ownerGUID), caveExclusiva.storages.time) - os.time()
			else
				ownerTimeLeft = getOfflinePlayerStorage(ownerGUID, caveExclusiva.storages.time) - os.time()
			end
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "Esta cave já pertence ao player ".. getPlayerNameByGUID(ownerGUID) ..", restam ".. getTimeString(ownerTimeLeft) .." para a cave estar livre novamente.")
			doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
		else
			caveExclusiva.setCaveTo(cid, itemEx.aid)
			doSendMagicEffect(getThingPos(cid), CONST_ME_FIREWORK_BLUE)
			doRemoveItem(item.uid)		
		end
	end
	return true
end 

 

Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 

 

Boa pessoal alguém pode me ajudar Resolver esse erro

  Citar

[4:44:08.914] [Error - Action Interface]
[4:44:08.917] data/actions/scripts/other/cave_action.lua:onUse
[4:44:08.921] Description:
[4:44:08.923] data/actions/scripts/other/cave_action.lua:8: attempt to index fie
ld '?' (a nil value)
[4:44:08.929] stack traceback:
[4:44:08.931]   data/actions/scripts/other/cave_action.lua:8: in function <data/
actions/scripts/other/cave_action.lua:1>

Script

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if itemEx.itemid == caveExclusiva.config.buyItemID then
		if getPlayerStorageValue(cid, caveExclusiva.storages.cave) > 0 then
			local caveName = caveExclusiva.caves[getPlayerStorageValue(cid, caveExclusiva.storages.cave)].caveName
			local timeLeft = getPlayerStorageValue(cid, caveExclusiva.storages.time) - os.time()
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você já é dono da cave de ".. caveName ..", aguarde ".. getTimeString(timeLeft) .." para comprar uma cave novamente.")
			doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
		elseif getGlobalStorageValue(caveExclusiva.caves[itemEx.aid].gStor) > 1 then
			local ownerGUID = getGlobalStorageValue(caveExclusiva.caves[itemEx.aid].gStor)
			local ownerTimeLeft = nil
			if isPlayerOnline(getPlayerNameByGUID(ownerGUID)) then
				ownerTimeLeft = getPlayerStorageValue(getPlayerByGUID(ownerGUID), caveExclusiva.storages.time) - os.time()
			else
				ownerTimeLeft = getOfflinePlayerStorage(ownerGUID, caveExclusiva.storages.time) - os.time()
			end
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "Esta cave já pertence ao player ".. getPlayerNameByGUID(ownerGUID) ..", restam ".. getTimeString(ownerTimeLeft) .." para a cave estar livre novamente.")
			doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
		else
			caveExclusiva.setCaveTo(cid, itemEx.aid)
			doSendMagicEffect(getThingPos(cid), CONST_ME_FIREWORK_BLUE)
			doRemoveItem(item.uid)		
		end
	end
	return true
end

 

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.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo