Boa noite galera, se alguem puder me ajudar, gostaria de saber como fazer esse script abaixo NÃO ser usado enquanto a pessoas tiver os storages abaixo e deixe uma mensagem dizendo: Você não pode usar o comando enquanto está no pvp.
- Storages: 85799, 58978, 70000, 80688
Script:
function onSay(cid)
local function getTime(s)
local h = math.floor(s / 3600)
local m = math.floor((s - h * 3600 )/ 60)
local s = s - h * 3600 - m * 60
return h .. ":" .. m .. ":" .. s
end
local message = "Você precisa esperar %s para usar novamente."
local time = getPlayerStorageValue(cid, 83922) - os.time()
local hours = 3
if time > 0 and time < hours * 3600 then
return doPlayerSendCancel(cid, message:format(getTime(time)))
end
setPlayerStorageValue(cid, 83922, os.time() + hours * 3600)
return doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
end
Obrigado !