Ir para conteúdo

Featured Replies

Postado

Não vi a alavanca 3, me desculpe hahaha, está ae:

 

Spoiler

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
}

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)
	return true
end

 

 

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

  • Respostas 16
  • Visualizações 618
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

Posted Images

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

Não vi a alavanca 3, me desculpe hahaha, está ae:

 

  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 2
												{x=118,y=379,z=7},
												{x=119,y=379,z=7}
											}
					},
					tempo = 20 --tempo do exaust em seg
}

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)
	return true
end

 

 

Deu certo..mais so pode arrumar uma coisa ai? tipo a alavanca no primeiro click ela nao vira! o id e 1945 ela virada pra lá<< na hora que usa queria que ela fosse pra la >> que o id é 1946
 

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

Postado

@Leomonti 

 

Quando você tinha falado q não funcionou eu refiz do 0, agr q vi q vc editou Oo

 

ta ae:

 

Spoiler

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 2
												{x=118,y=379,z=7},
												{x=119,y=379,z=7}
											}
					},
					tempo = 20 --tempo do exaust em seg
}


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])
	return true
end

 

 

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

@Leomonti 

 

Quando você tinha falado q não funcionou eu refiz do 0, agr q vi q vc editou Oo

 

ta ae:

 

  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 2
												{x=118,y=379,z=7},
												{x=119,y=379,z=7}
											}
					},
					tempo = 20 --tempo do exaust em seg
}


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])
	return true
end

 

''
 

 

nossa cara sinto muito mesmo por isso! hahaha
cara aproveitando da sua bondade..tem como aparecer a msg pra quem puxa a alavanca?
tipo "voce tem 5 min para atravessar a pedra"

 

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

Postado

@Leomonti 

 

Assim?

 

Spoiler

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

 

 

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