Postado Junho 4, 2023 2 anos Solução Preciso de revscript bem simples mesmo quando player da use no jornal 8981 dourado aparece contdown 30 60 minutos e segundos e action/movements movements eu ja fiz só preciso do script que funcione no action no casso esse script preciso de suporte quem poder ajuda eu agraço esse ai é action storage piso que ele vai passar se der use no jornal no set ou na bp item sumi só pode obte se puxa alavanca ja fiz só esse action que ta me encabulando. local storageValue = 13741 local itemID = 8981 local teleportPosition = {x = 154, y = 51, z = 7} local timeInterval = 30 * 60 cdstorage = 123457 } function onUse(player, item, fromPosition, target, toPosition, isHotkey) if player:getStorageValue(config.cdstorage) >= os.time() then player:sendTextMessage(MESSAGE_INFO_DESCR, remainTime(player:getStorageValue(config.cdstorage) - os.time())) return true end function onUse(cid, item, frompos, item2, topos) if getPlayerStorageValue(cid, storageValue) ~= -1 then doPlayerSendCancel(cid, "Você já tem acesso a essa funcionalidade.") return true end if not doPlayerRemoveItem(cid, itemID, 1) then doPlayerSendCancel(cid, "Você precisa ter o item no set ou na bp para usar essa funcionalidade e de (use).") return true end local currentTime = os.time() local expirationTime = currentTime + timeInterval setPlayerStorageValue(cid, storageValue, expirationTime) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você ganhou acesso à área por 30 minutos.") doPlayerRemoveItem(cid, itemID, 1) -- Adiciona o item novamente (opcional) doSetItemActionId(item.uid, 0) -- Remove a action id do item (opcional) doPlayerRemoveItem(cid, itemID, 1) return true end function onLogin(cid) local currentTime = os.time() local expirationTime = getPlayerStorageValue(cid, storageValue) if expirationTime ~= -1 and currentTime >= expirationTime then doTeleportThing(cid, teleportPosition, false) setPlayerStorageValue(cid, storageValue, -1) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Seu acesso expirou. Você foi teleportado para o templo.") end function remainTime(seconds) hrs = math.floor(seconds / 3600) mins = math.floor((seconds - (hrs * 3600)) / 60) secs = math.floor(seconds - (hrs * 3600) - mins * 60) return string.format("Sorry, you can only use this item again in %d hour(s), %d minute(s) and %d second(s).", hrs, mins, secs) end local timeDifference = currentTime - getPlayerStorageValue(cid, "lastTimeCheck") if timeDifference >= timeInterval then local remainingTime = math.floor((expirationTime - currentTime) / 60) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Tempo restante: " .. remainingTime .. " minutos.") setPlayerStorageValue(cid, "lastTimeCheck", currentTime) end 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.