Postado Quinta às 19:592 dias Alguem modifica esse script, ele esta em dias, quero em horas. e pra ser puxado tem que ter cobrar um item (6527) caso o player n tenha o item, nao da pra puxar a alavanca. Grato desde de ja ! Citar local config = { daily = "no", level = 100, storage = 30015 } local playerPosition = { {x = 247, y = 659, z = 13}, {x = 247, y = 660, z = 13}, {x = 247, y = 661, z = 13}, {x = 247, y = 662, z = 13} } local newPosition = { {x = 189, y = 650, z = 13}, {x = 189, y = 651, z = 13}, {x = 189, y = 652, z = 13}, {x = 189, y = 653, z = 13} } -- Do not modify the declaration lines below. local players = {} local failed = true config.daily = getBooleanFromString(config.daily) function onUse(cid, item, fromPosition, itemEx, toPosition) if(item.itemid == 1946) then if(config.daily) then doPlayerSendCancel(cid, "Sorry, not possible.") else doTransformItem(item.uid, item.itemid - 1) end return true end if(item.itemid ~= 1945) then return true end for i, pos in ipairs(playerPosition) do pos.stackpos = STACKPOS_TOP_CREATURE players = getThingFromPos(playerPosition).uid if(players > 0 and isPlayer(players) and getPlayerStorageValue(players.uid, config.storage) == -1 and getPlayerLevel(players.uid) >= config.level) then failed = false end if(failed) then doPlayerSendCancel(cid, "Sorry, not possible.") return true end failed = true end for i, pid in ipairs(players) do doSendMagicEffect(playerPosition, CONST_ME_POFF) doTeleportThing(pid, newPosition, false) doSendMagicEffect(newPosition, CONST_ME_ENERGYAREA) end doTransformItem(item.uid, item.itemid + 1) return true end Editado Quinta às 20:022 dias por Doidodepeda (veja o histórico de edições)
Postado Ontem às 19:031 dia Salve man!, testa ailocal config = {cooldownHours = 6, -- tempo em horas para usar novamentelevel = 100,storage = 30015, -- armazena o timestamp da última vez que usourequiredItem = 6527,playerPositions = {{x = 247, y = 659, z = 13},{x = 247, y = 660, z = 13},{x = 247, y = 661, z = 13},{x = 247, y = 662, z = 13}},teleportPositions = {{x = 189, y = 650, z = 13},{x = 189, y = 651, z = 13},{x = 189, y = 652, z = 13},{x = 189, y = 653, z = 13}}}function onUse(cid, item, fromPosition, itemEx, toPosition)if item.itemid == 1946 thendoTransformItem(item.uid, 1945)return trueendlocal players = {}for i, pos in ipairs(config.playerPositions) dolocal creature = getTopCreature(pos).uidif creature > 0 and isPlayer(creature) then-- Verificações individuaisif getPlayerLevel(creature) < config.level thendoPlayerSendCancel(cid, "Todos os jogadores precisam ter level " .. config.level .. " ou mais.")return trueendif getPlayerItemCount(creature, config.requiredItem) < 1 thendoPlayerSendCancel(cid, "Todos os jogadores precisam ter o item necessário (ID: " .. config.requiredItem .. ").")return trueendlocal lastUse = getPlayerStorageValue(creature, config.storage)if lastUse ~= -1 and os.time() - lastUse < (config.cooldownHours * 3600) thenlocal remaining = math.ceil(((lastUse + config.cooldownHours * 3600) - os.time()) / 60)doPlayerSendCancel(cid, "Todos os jogadores devem esperar " .. remaining .. " minutos para usar novamente.")return trueendtable.insert(players, creature)elsedoPlayerSendCancel(cid, "Todos os quadrados precisam estar ocupados por jogadores.")return trueendend-- Tudo ok, teleporta e consome o itemfor i, player in ipairs(players) dodoTeleportThing(player, config.teleportPositions[i], false)doSendMagicEffect(config.playerPositions[i], CONST_ME_POFF)doSendMagicEffect(config.teleportPositions[i], CONST_ME_ENERGYAREA)doPlayerRemoveItem(player, config.requiredItem, 1)setPlayerStorageValue(player, config.storage, os.time())enddoTransformItem(item.uid, 1946)return trueend Editado ontem às 19:051 dia por Darcio Antonio Tentando colocar codigo! para ficar bonitinho! (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.