Postado Junho 23, 2015 10 anos Colocar pra quem tiver em Area PZ usar esse item, obgd local t = { delay = 5, -- Tempo em segundos para usar novamente. storage = 45555 -- Storage para utilizar. } function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerStorageValue(cid, t.storage) < os.time() then doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) setPlayerStorageValue(cid, t.storage, t.delay + os.time()) doRemoveItem(item.uid) doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT) doSendMagicEffect(fromPosition, CONST_ME_TELEPORT) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você precisa aguardar ".. getPlayerStorageValue(cid, t.storage) - os.time() .." segundo(s) para usar novamente.") end return true end
Postado Junho 23, 2015 10 anos Solução local t = { delay = 5, -- Tempo em segundos para usar novamente. storage = 45555 -- Storage para utilizar. } function onUse(cid, item, fromPosition, itemEx, toPosition) if not getTileInfo(getThingPos(cid)).protection then return doPlayerSendCancel(cid, "This item works only in PZ") and doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) and false end if getPlayerStorageValue(cid, t.storage) < os.time() then doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) setPlayerStorageValue(cid, t.storage, t.delay + os.time()) doRemoveItem(item.uid) doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT) doSendMagicEffect(fromPosition, CONST_ME_TELEPORT) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você precisa aguardar ".. getPlayerStorageValue(cid, t.storage) - os.time() .." segundo(s) para usar novamente.") end return true end Se quiser sua dúvida tirada, mande PM com os links, e não com a dúvida (outros podem ter a mesma dúvida, e o fórum serve para ser usado). Tópicos: [FAQ] BBCODE [LIB] Constant [RME] Administrando bordas. [TALK] Broadcast Editável. [TALK] Sugest. [TALK] Checkpoint. [MOVE] Pântano pegajoso. [ACTION] Piggy Bank. (Cassino). [GLOBAL] Uptime Ad. [C0DE] Consertando 'Invalid Password' [PROGRAM] Quest Maker
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.