Ir para conteúdo

Featured Replies

Postado

Galera, antes de tudo quero informar que eu ja procurei e achei alguns scripts iguais a esse que eu vou pedir porem quando eu tento instalar no servidor, ele nao funciona.

 

Queria uma bau onde o Player ganhasse apenas 1 vez os itens de sua respectiva classe.

 

Informaçoes:

 

Sorc: 2458 ,1 / 2464 ,1 / 2648 ,1 / 2513 ,1 / 2190 ,1

Druid: 2458 ,1 / 2464 ,1 / 2648 ,1 / 2513 ,1 / 2182 ,1

Paladin: 2458 ,1 / 2464 ,1 / 2648 ,1 / 2513 ,1 / 2389 ,1

Knight: 2458 ,1 / 2464 ,1 / 2648 ,1 / 2513 ,1 / 2386 ,1 / 2389 ,1 / 2376 ,1

 

Obs: esse ,1  Seria a quantidade do item.

 Tibia 8.60

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

Resolvido por KotZletY

Ir para solução
  • Respostas 13
  • Visualizações 790
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • @caioitalo1 cara, você está fazendo algo errado com certeza, testei aqui em um baú e ta 100%.   <action actionid="123172" event="script" value="vochest.lua"/>  

  • @caioitalo1 local voc = getPlayerVocation(cid) local sto = 127381 local pos = getCreaturePosition(cid) local all = {2458, 2464, 2648, 2513} local sorc = 2190 local druid = 2182 local pala = 2389 l

Postado

actions/scripts/ cria um arquivo ai .lua com isso dentro

Spoiler

local voc = getPlayerVocation(cid)
local sto = 127381
local pos = getCreaturePosition(cid)
local tid = {
		all = {2458, 2464, 2648, 2513},
		sorc = {2190},
		druid = {2182},
		pala = {2389},
		kina = {2389, 2376}
}

function onUse(cid, item, frompos, item2, topos)

if getPlayerStorageValue(cid, sto) <= 0 then
	for _, v in pairs(tid.all) do
		doPlayerAddItem(cid, v, 1)
	end
		if voc == 1 then
			doPlayerAddItem(cid, tid.sorc, 1)
		elseif voc == 2 then
			doPlayerAddItem(cid, tid.druid, 1)
		elseif voc == 3 then
			doPlayerAddItem(cid, tid.pala, 1)
		elseif voc == 4 then
			for d, k in pairs(tid.kina) do
				doPlayerAddItem(cid, k, 1)
			end
		end
	doSendMagicEffect(pos, CONST_ME_MAGIC_BLUE)
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations, you completed the quest!")
	setPlayerStorageValue(cid, sto, 1)
else
	doSendMagicEffect(pos, CONST_ME_POFF)
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, you have already took the items.")
return true
end

 

 

actions.xml

<action actionid="123172" event="script" value="nome do arquivo.lua"/>

 

Ai vc coloca essa actionid ai no baú.

 

Da um feedback dps pra eu saber se funciona!

Postado
  • Autor
9 minutos atrás, Sekk disse:

actions/scripts/ cria um arquivo ai .lua com isso dentro

  Mostrar conteúdo oculto


local voc = getPlayerVocation(cid)
local sto = 127381
local pos = getCreaturePosition(cid)
local tid = {
		all = {2458, 2464, 2648, 2513},
		sorc = {2190},
		druid = {2182},
		pala = {2389},
		kina = {2389, 2376}
}

function onUse(cid, item, frompos, item2, topos)

if getPlayerStorageValue(cid, sto) <= 0 then
	for _, v in pairs(tid.all) do
		doPlayerAddItem(cid, v, 1)
	end
		if voc == 1 then
			doPlayerAddItem(cid, tid.sorc, 1)
		elseif voc == 2 then
			doPlayerAddItem(cid, tid.druid, 1)
		elseif voc == 3 then
			doPlayerAddItem(cid, tid.pala, 1)
		elseif voc == 4 then
			for d, k in pairs(tid.kina) do
				doPlayerAddItem(cid, k, 1)
			end
		end
	doSendMagicEffect(pos, CONST_ME_MAGIC_BLUE)
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations, you completed the quest!")
	setPlayerStorageValue(cid, sto, 1)
else
	doSendMagicEffect(pos, CONST_ME_POFF)
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, you have already took the items.")
return true
end

 

 

actions.xml


<action actionid="123172" event="script" value="nome do arquivo.lua"/>

 

Ai vc coloca essa actionid ai no baú.

 

Da um feedback dps pra eu saber se funciona!

Irmao, deu esse seguinte error:

 

[Error - LuaScriptInterface::loadFile] data/actions/scripts/vochest.lua:36: 'end' expected (to close 'function' at line 12) near '<eof>'
[Warning - Event::loadScript] Cannot load script (data/actions/scripts/vochest.lua)
data/actions/scripts/vochest.lua:36: 'end' expected (to close 'function' at line 12) near '<eof>'

Postado

Nossa foi mal uahsuhsash

esqueci de colocar um end

 

local voc = getPlayerVocation(cid)
local sto = 127381
local pos = getCreaturePosition(cid)
local tid = {
		all = {2458, 2464, 2648, 2513},
		sorc = {2190},
		druid = {2182},
		pala = {2389},
		kina = {2389, 2376}
}

function onUse(cid, item, frompos, item2, topos)

if getPlayerStorageValue(cid, sto) <= 0 then
	for _, v in pairs(tid.all) do
		doPlayerAddItem(cid, v, 1)
	end
		if voc == 1 then
			doPlayerAddItem(cid, tid.sorc, 1)
		elseif voc == 2 then
			doPlayerAddItem(cid, tid.druid, 1)
		elseif voc == 3 then
			doPlayerAddItem(cid, tid.pala, 1)
		elseif voc == 4 then
			for d, k in pairs(tid.kina) do
				doPlayerAddItem(cid, k, 1)
			end
		end
	doSendMagicEffect(pos, CONST_ME_MAGIC_BLUE)
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations, you completed the quest!")
	setPlayerStorageValue(cid, sto, 1)
else
	doSendMagicEffect(pos, CONST_ME_POFF)
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, you have already took the items.")
end
return true
end

 

testa ai kkk

Postado
  • Autor
2 horas atrás, Sekk disse:

Nossa foi mal uahsuhsash

esqueci de colocar um end

 


local voc = getPlayerVocation(cid)
local sto = 127381
local pos = getCreaturePosition(cid)
local tid = {
		all = {2458, 2464, 2648, 2513},
		sorc = {2190},
		druid = {2182},
		pala = {2389},
		kina = {2389, 2376}
}

function onUse(cid, item, frompos, item2, topos)

if getPlayerStorageValue(cid, sto) <= 0 then
	for _, v in pairs(tid.all) do
		doPlayerAddItem(cid, v, 1)
	end
		if voc == 1 then
			doPlayerAddItem(cid, tid.sorc, 1)
		elseif voc == 2 then
			doPlayerAddItem(cid, tid.druid, 1)
		elseif voc == 3 then
			doPlayerAddItem(cid, tid.pala, 1)
		elseif voc == 4 then
			for d, k in pairs(tid.kina) do
				doPlayerAddItem(cid, k, 1)
			end
		end
	doSendMagicEffect(pos, CONST_ME_MAGIC_BLUE)
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations, you completed the quest!")
	setPlayerStorageValue(cid, sto, 1)
else
	doSendMagicEffect(pos, CONST_ME_POFF)
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, you have already took the items.")
end
return true
end

 

testa ai kkk

Irmao, dessa vez pegou porem ele só esta entregando os itens listado no ALL, [ all = {2458, 2464, 2648, 2513},]. 

Tambem deu um error na distro que eu nao sei dizer se pode ocorrer problemas com o server futuramente.

 

Error:

Citar

 

[Error - Action Interface]
data/actions/scripts/vochest.lua
Description:
(internalGetPlayerInfo) Player not found when requesting player info #6

[Error - Action Interface]
data/actions/scripts/vochest.lua
Description:
(luaGetThingPosition) Thing not found

 

 

E do mesmo jeito, vlw por estar tentando me ajudar. xD

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