Ir para conteúdo

Featured Replies

Postado

@maleskinho 

 

testa assim:

 

 

function onUse(cid, item, frompos, item2, topos)
	local StorageExaust = 722404 -- Mude Aqui caso queira trocar a storage.
	local Time = 120 -- Valores em segundos que ele terá que esperar.
	local rand = math.random(1, 100)	
	
	if item.itemid == 12688 and item.actionid == 45492 then
		if getPlayerStorageValue(cid, StorageExaust) > os.time() then
			doPlayerSendCancel(cid, "Você não pode usar este item agora.") return true
		end
	end
	if item.itemid == 11253 and item.actionid == 45492 then
		if getPlayerStorageValue(cid, 45490) <= 0 then
			doPlayerSendCancel(cid, "Speak with Sandomo to use this item.") return true
		end	
		if rand > 25 then
			doCreateMonster("guzzlemaw", getCreaturePosition(cid), false, true)
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You ransack the pile but fail to find any useful parts.");
			doSendMagicEffect(topos, CONST_ME_MAGIC_RED)
		else
			setPlayerStorageValue(cid, 45491, getPlayerStorageValue(cid, 45491)+1)
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Amidst the pile of various bones you find a large, hollow part, similar to a pipe.");
			doSendMagicEffect(topos, CONST_ME_MAGIC_GREEN)
		end
		doTransformItem(item.uid, 12688)
		doDecayItem(item.uid)
		setPlayerStorageValue(cid, StorageExaust, os.time() + Time)
	end
	return true
end

 

  • Respostas 19
  • Visualizações 904
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • @maleskinho de boa, usa a mesma TAG que te passei e no código assim:     function onUse(cid, item, fromPosition, itemEx, toPosition) local minutes = 2 local rand = math.random(1, 100)

  • Funcionou, consegue adicionar o texto pra 2 min? ai finalizou haha

  • @maleskinho como assim? o texto aparecer para o jogador que clicou depois de 2 minutos? não entendi man usa assim     if item.itemid ~= 11253 then doCreatureSay(cid, "Wait 2 minutes

Postado
  • Autor
  Em 16/02/2020 em 22:32, Vodkart disse:

@maleskinho 

 

testa assim:

 

 

function onUse(cid, item, frompos, item2, topos)
	local StorageExaust = 722404 -- Mude Aqui caso queira trocar a storage.
	local Time = 120 -- Valores em segundos que ele terá que esperar.
	local rand = math.random(1, 100)	
	
	if item.itemid == 12688 and item.actionid == 45492 then
		if getPlayerStorageValue(cid, StorageExaust) > os.time() then
			doPlayerSendCancel(cid, "Você não pode usar este item agora.") return true
		end
	end
	if item.itemid == 11253 and item.actionid == 45492 then
		if getPlayerStorageValue(cid, 45490) <= 0 then
			doPlayerSendCancel(cid, "Speak with Sandomo to use this item.") return true
		end	
		if rand > 25 then
			doCreateMonster("guzzlemaw", getCreaturePosition(cid), false, true)
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You ransack the pile but fail to find any useful parts.");
			doSendMagicEffect(topos, CONST_ME_MAGIC_RED)
		else
			setPlayerStorageValue(cid, 45491, getPlayerStorageValue(cid, 45491)+1)
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Amidst the pile of various bones you find a large, hollow part, similar to a pipe.");
			doSendMagicEffect(topos, CONST_ME_MAGIC_GREEN)
		end
		doTransformItem(item.uid, 12688)
		doDecayItem(item.uid)
		setPlayerStorageValue(cid, StorageExaust, os.time() + Time)
	end
	return true
end

 

 

só diz a msg "you cannot  use this object" sem erros na distro.

Postado

@maleskinho Deve ser porque quando vira o item 12688 ele perde o actionID.

 

 

o certo é fazer no proprio script, depois de 2 minutos, voltar a ser o item de antes;

@maleskinho 

 

faz assim:

 

function onUse(cid, item, frompos, item2, topos)
	local minutes = 2
	local rand = math.random(1, 100)
	local pos = {x = 138, y = 52, z=7} -- position do item
	
	if getPlayerStorageValue(cid, 45490) <= 0 then
		doPlayerSendCancel(cid, "Speak with Sandomo to use this item.") return true
	end	
	
	if rand > 25 then
		doCreateMonster("guzzlemaw", getCreaturePosition(cid))
		doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You ransack the pile but fail to find any useful parts.")
		doSendMagicEffect(topos, CONST_ME_MAGIC_RED)
	else
		setPlayerStorageValue(cid, 45491, getPlayerStorageValue(cid, 45491)+1)
		doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Amidst the pile of various bones you find a large, hollow part, similar to a pipe.");
		doSendMagicEffect(topos, CONST_ME_MAGIC_GREEN)
	end
	doTransformItem(item.uid, 12688)
	addEvent(function() doTransformItem(getTileItemById(pos, 12688).uid, 11253) end, minutes*60000) 
	return true
end

 

Postado
  • Autor
  Em 17/02/2020 em 00:06, Vodkart disse:

@maleskinho Deve ser porque quando vira o item 12688 ele perde o actionID.

 

 

o certo é fazer no proprio script, depois de 2 minutos, voltar a ser o item de antes;

 

Deixei o script normal, coloquei a id 11253 pra ficar depois que clicar, mas ai eu consigo clicar toda hora sem parar. ;s

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