Ir para conteúdo

Featured Replies

Postado
  • Autor
27 minutos atrás, antharaz disse:

@Leomonti 

 

Assim?

 

  Ocultar conteúdo


local config = {
					action_ids = {
									alavanca1 = 12550, --ACTIONID DA ALAVANCA1
									alavanca2 = 12551, --ACTIONID DA ALAVANCA2
									alavanca3 = 12552 --ACTIONID DA ALAVANCA3
					},
					id_pedra = 3616, --ID DA PEDRA
					pos_pedra = {
								[12550] = { --POS DAS PEDRAS DA ALAVANCA 1
												{x=118,y=379,z=7},
												{x=119,y=379,z=7}
											},
								[12551] = { --POS DAS PEDRAS DA ALAVANCA 2
												{x=118,y=379,z=7},
												{x=119,y=379,z=7}
											},
								[12552] = { --POS DAS PEDRAS DA ALAVANCA 3
												{x=118,y=379,z=7},
												{x=119,y=379,z=7}
											}
					},
					tempo = 20, --tempo do exaust em seg
					msg = 'Você tem 5 min para atravessar a pedra.'
}


local t_alavanca = {
[1946] = 1945,
[1945] = 1946
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local id = item.actionid
	local exaust = getItemAttribute(item.uid, 'exaust')
	exaust = exaust and exaust or 0
	if os.time() <= exaust then
		doSendMagicEffect(fromPosition,2)
		return false
	end
	for _,pos in pairs(config.pos_pedra[id]) do
		local pedra = getTileItemById(pos, config.id_pedra)
		doRemoveItem(pedra.uid)
	end
	doItemSetAttribute(item.uid, 'exaust',(os.time() + config.tempo))
	addEvent(function()
		for _,pos in pairs(config.pos_pedra[id]) do
			doCreateItem(config.id_pedra,1,pos)
		end
	end,config.tempo*1000)
	doTransformItem(item.uid,t_alavanca[item.itemid])
	doPlayerSendTextMessage(cid, 22, config.msg)
	return true
end

 

 


Perfeito! muito obrigado cara me ajudou muito

PEDIDO FECHADO!

  • 3 weeks later...
  • Respostas 16
  • Visualizações 619
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

Posted Images

Postado
Em Saturday, September 30, 2017 em 02:41, antharaz disse:

@Leomonti 

 

Assim?

 

  Mostrar conteúdo oculto


local config = {
					action_ids = {
									alavanca1 = 12550, --ACTIONID DA ALAVANCA1
									alavanca2 = 12551, --ACTIONID DA ALAVANCA2
									alavanca3 = 12552 --ACTIONID DA ALAVANCA3
					},
					id_pedra = 3616, --ID DA PEDRA
					pos_pedra = {
								[12550] = { --POS DAS PEDRAS DA ALAVANCA 1
												{x=118,y=379,z=7},
												{x=119,y=379,z=7}
											},
								[12551] = { --POS DAS PEDRAS DA ALAVANCA 2
												{x=118,y=379,z=7},
												{x=119,y=379,z=7}
											},
								[12552] = { --POS DAS PEDRAS DA ALAVANCA 3
												{x=118,y=379,z=7},
												{x=119,y=379,z=7}
											}
					},
					tempo = 20, --tempo do exaust em seg
					msg = 'Você tem 5 min para atravessar a pedra.'
}


local t_alavanca = {
[1946] = 1945,
[1945] = 1946
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local id = item.actionid
	local exaust = getItemAttribute(item.uid, 'exaust')
	exaust = exaust and exaust or 0
	if os.time() <= exaust then
		doSendMagicEffect(fromPosition,2)
		return false
	end
	for _,pos in pairs(config.pos_pedra[id]) do
		local pedra = getTileItemById(pos, config.id_pedra)
		doRemoveItem(pedra.uid)
	end
	doItemSetAttribute(item.uid, 'exaust',(os.time() + config.tempo))
	addEvent(function()
		for _,pos in pairs(config.pos_pedra[id]) do
			doCreateItem(config.id_pedra,1,pos)
		end
	end,config.tempo*1000)
	doTransformItem(item.uid,t_alavanca[item.itemid])
	doPlayerSendTextMessage(cid, 22, config.msg)
	return true
end

 

 

Vou usar no meu projeto :D

dx6rIyi.png

Postado
Em 17/10/2017 em 01:15, antharaz disse:

@amoxicilina 

 

Seu verver não tem a função getItemAttibute, mas todo server tem uma função que faz a mesma coisa, agora basta você descobrir qual função que é e substituir.

Como posso descobrir qual seria essa função ?. eu uso o "Oganza-Server-master". link do servidor que estou usando: 

 @antharaz

 

@rogaforyn2 continuo com o mesmo erro.

 

 

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

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.7k

Informação Importante

Confirmação de Termo