Ir para conteúdo

Featured Replies

Postado

como faço pra adicionar tempo a alavanca?

 

function onUse(cid, item, frompos, item2, topos)
    wall1 = {x=32874, y=32354, z=14, stackpos=1}    
    getwall1 = getThingfromPos(wall1)
    
    pedra1 = {x=32851, y=32333, z=12, stackpos=1}
    pedra2 = {x=32852, y=32333, z=12, stackpos=1}    
    getpedra1 = getThingfromPos(pedra1)
    getpedra2 = getThingfromPos(pedra2)
    
    if item.itemid == 1945 and getwall1.itemid == 1946 then
        doTransformItem(item.uid,item.itemid+1)
        doRemoveItem(getpedra1.uid,1)
        doRemoveItem(getpedra2.uid,1)
    elseif item.itemid == 1946 then
        doTransformItem(item.uid,item.itemid-1)    
    else
        doPlayerSendCancel(cid,"Sorry, not possible.")
    end

    return 1
end

Postado

@bpm91 

local t = {
storage = 676631,  -- storage, so mude se tiver usando pra outra coisa.
tempo = 24, -- Tempo em minutos.
}

function onUse(cid, item, frompos, item2, topos)
    wall1 = {x=32874, y=32354, z=14, stackpos=1}    
    getwall1 = getThingfromPos(wall1)
    
    pedra1 = {x=32851, y=32333, z=12, stackpos=1}
    pedra2 = {x=32852, y=32333, z=12, stackpos=1}    
    getpedra1 = getThingfromPos(pedra1)
    getpedra2 = getThingfromPos(pedra2)
	if getPlayerStorageValue(cid, t.storage) < os.time() then
		if item.itemid == 1945 and getwall1.itemid == 1946 then
			doTransformItem(item.uid,item.itemid+1)
			doRemoveItem(getpedra1.uid,1)
			doRemoveItem(getpedra2.uid,1)
		elseif item.itemid == 1946 then
			doTransformItem(item.uid,item.itemid-1)    
		else
			doPlayerSendCancel(cid,"Sorry, not possible.")
		end
	else
		doSendMagicEffect(getPlayerPosition(cid), 3)
	   doPlayerPopupFYI(cid, "Voce precisa aguardar ".. getPlayerStorageValue(cid, t.storage) - os.time() .." segundos.")
    end

    return 1
end

 

  • 2 years later...

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