Postado Agosto 19, 2019 5 anos 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 Agosto 20, 2019 5 anos @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
Postado Julho 18, 2022 2 anos 1 Editado Julho 18, 2022 2 anos por Vitorelias (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.