Ir para conteúdo

Alienbear

Membro
  • Registro em

  • Última visita

Solutions

  1. Alienbear's post in sistema de patente/titulo was marked as the answer   
    Tem sim, você vai pegar o metodo que é dado esse "elo" ao jogador.
    Que no seu script é por storage.
    Ai você vai criar um script pro tipo de "atributo" que você quer fornecer.
     
    Ah quero que ganhe 1000 de vida e 500 de mana se for elo F
    if getPlayerStorageValue(cid, fragsStorage) == 5 then ai você coloca tudo que precisa acontecer, fazendo essas verificações de storage.
     
    Pra adicionar vida/mana eu recomendo vc usar onLogin ou onAdvanced.
     
    Se ajudei da like/rep+ ?
     
     
  2. Alienbear's post in (Resolvido)Script de anuncio para invasão de boss específico was marked as the answer   
    Bom dia amigo, olha q interessante.
    O script q você "fez" apenas manda mensagem, e você está declarando algumas funções "msg e msg2" que não são nem chamadas no script.
     
    if getPlayerAccess(cid) é pra verificar o acesso de cargo.
     
    Pesquise sobre como usar addEvent, aqui no forum ensina vou mandar o tutorial:
     
    E também veja esse script que foi criado recentemente para usar um item e sumonar um monstro:
     
    Estude isso que te mandei e tente criar seu próprio script.
    Continue usand function onSay e os broadcast também o resto você estuda e analisa oq te mandei.
     
    Aprender é mais fácil do que pedir ajuda você vai ver ?
     
    Se te ajudei deixe like/rep+
    Caso precise de mais ajuda, pode deixar like/rep+ que irei ajudando sim.
  3. Alienbear's post in (Resolvido)Script Action Boss was marked as the answer   
    Olá meu lindo amigo tudo bem?
    Vamos resolver
     
    Use esse código:
    local config = { bossName = "Maxxenius", bossName2 = "Glooth-Generator", bossName3 = "Glooth-Generator", bossName4 = "Glooth-Generator", summonName = "Rift Invader", bossPos = Position{x = 31983, y = 31982, z = 15}, horror = Position{x = 31982, y = 31984, z = 15}, phobia = Position{x = 31989, y = 31984, z = 15}, fear = Position{x = 31984, y = 31987, z = 15}, centerRoom = Position{x = 31984, y = 31985, z = 15}, -- Center Room exitPosition = Position{x = 32001, y = 31984, z = 15}, -- Exit Position newPos = Position{x = 31984, y = 31990, z = 15}, -- Player Position on room playerPositions = { Position{x = 32003, y = 31980, z = 15}, Position{x = 32003, y = 31981, z = 15}, Position{x = 32003, y = 31982, z = 15}, Position{x = 32003, y = 31983, z = 15}, Position{x = 32003, y = 31984, z = 15} }, range = 30, time = 30, -- time in minutes to remove the player } local function clearFerumbrasRoom() local spectators = Game.getSpectators(config.bossPos, false, false, 10, 10, 10, 10) for i = 2, #spectators do local spectator = spectators[i] if spectator:isPlayer() then spectator:teleportTo(config.exitPosition) spectator:getPosition():sendMagicEffect(CONST_ME_TELEPORT) spectator:say('Time out! You were teleported out by strange forces.', TALKTYPE_MONSTER_SAY) elseif spectator:isMonster() then spectator:remove() end end end local ferumbrasAscendantLever = Action() function ferumbrasAscendantLever.onUse(player, item, fromPosition, target, toPosition, isHotkey) if item.itemid == 9825 then if player:getPosition() ~= Position{x = 32003, y = 31980, z = 15} then return true end for x = 32003, 32003 do for y = 31980, 31984 do local playerTile = Tile(Position(x, y, 15)):getTopCreature() if playerTile and playerTile:isPlayer() then if playerTile:getStorageValue(421516177) > os.time() then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You or a member in your team have to wait 20 hours to face Boss again!") item:transform(9826) return true end end end end local specs, spec = Game.getSpectators(config.centerRoom, false, false, 15, 15, 15, 15) for i = 1, #specs do spec = specs[i] if spec:isPlayer() then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "There's someone fighting with Boss.") return true end end local spectators = Game.getSpectators(config.bossPos, false, false, 15, 15, 15, 15) for i = 1, #spectators do local spectator = spectators[i] if spectator:isMonster() then spectator:remove() end end for x = 32003, 32003 do for y = 31980, 31984 do local playerTile = Tile(Position(x, y, 15)):getTopCreature() if playerTile and playerTile:isPlayer() then playerTile:getPosition():sendMagicEffect(CONST_ME_POFF) playerTile:teleportTo(config.newPos) playerTile:getPosition():sendMagicEffect(CONST_ME_TELEPORT) playerTile:setStorageValue(421516177, os.time() + 20 * 60 * 60) -- 14 days player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have 30 minutes to kill and loot this boss. Otherwise you will lose that chance and will be kicked out.") addEvent(clearFerumbrasRoom, 60 * config.time * 1000, player:getId(), config.centerRoom, config.range, config.range, config.exitPosition) item:transform(9826) end end end Game.createMonster(config.bossName, config.bossPos, true, true) Game.createMonster(config.bossName2, config.horror, true, true) Game.createMonster(config.bossName3, config.phobia, true, true) Game.createMonster(config.bossName4, config.fear, true, true) elseif item.itemid == 9826 then item:transform(9825) return true end end ferumbrasAscendantLever:aid(30014) ferumbrasAscendantLever:register()  
    Motivo do erro: Quando você usa um for neste caso deste script ele vai executar tudo que está dentro do for repetindo a quantidade de players,
    se for 1 player será 1 repetição, 2 players 2 repetições, 3 players 3 repetições e assim por diante.
    agora removi de dentro do for e os monstros nascerão apenas 1 de cada como está no arquivo.
  4. Alienbear's post in (Resolvido)Intervalo na execução da script was marked as the answer   
    -- -- Stuffed Dragon (sid: 5791) -- -- TODO: -- Make "You... will.... burn!!" more rare. -- SOUNDS = {"Fchhhhhh!", "Zchhhhhh!", "Grooaaaaar*cough*", "Aaa... CHOO!", "You... will.... burn!!"} function onUse(cid, item, fromPosition, itemEx, toPosition) if (getPlayerStorageValue(cid, 11560) <= os.time()) then local random = math.random(1, table.maxn(SOUNDS)) if(fromPosition.x ~= CONTAINER_POSITION) then doCreatureSay(cid, SOUNDS[random], TALKTYPE_ORANGE_1, fromPosition) setPlayerStorageValue(cid,11560,os.time()+2) else doCreatureSay(cid, SOUNDS[random], TALKTYPE_ORANGE_1) setPlayerStorageValue(cid,11560,os.time()+2) end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED,"Você só poderá usar este item novamente em " .. (getPlayerStorageValue(cid, 11560)-os.time()+(0)) .. " segundos.") end if(random == 5) then -- "You... will.... burn!!" doTargetCombatHealth(0, cid, COMBAT_PHYSICALDAMAGE, -1, -1, CONST_ME_EXPLOSIONHIT) setPlayerStorageValue(cid,11560,os.time()+2) end return TRUE end
  5. Alienbear's post in (Resolvido)[Ajuda] Montaria não sai was marked as the answer   
    vai em data/creaturescripts/scripts e copia qualquer arquivo la, renomeia pra dismount.lua
    e cole isso dentro:
     
    function onLogout(cid) doPlayerSetMounted(cid, mounting, 1) return true end <event type="logout" name="dismount" event="script" value="dismount.lua"/>

    em creaturescripts/scripts abra o login.lua
    cole isto:

    registerCreatureEvent(cid, "dismount")
  6. Alienbear's post in (Resolvido)Teleport que adicione Storages was marked as the answer   
    pode ser colocado isso em um tile que ficará em baixo do teleport...

    quer q eu faça?

    function onStepIn(cid, item, pos) local storage = NUMERO DA STORAGE if getPlayerStorageValue(cid, storage) < 2 then setPlayerStorageValue(cid, storage, 2) end return true end
  7. Alienbear's post in (Resolvido)[Error] Doors was marked as the answer   
    local function checkStackpos(item, position) position.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE local thing = getThingFromPos(position) position.stackpos = STACKPOS_TOP_FIELD local field = getThingFromPos(position) return (item.uid == thing.uid or thing.itemid < 100 or field.itemid == 0) end function onUse(cid, item, fromPosition, itemEx, toPosition) if(getItemLevelDoor(item.itemid) > 0) then if(item.actionid == 189) then if(isPremium(cid) ~= TRUE) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.") return TRUE end doTransformItem(item.uid, item.itemid + 1) doTeleportThing(cid, toPosition, TRUE) return TRUE end local gender = item.actionid - 186 if(isInArray({PLAYERSEX_FEMALE, PLAYERSEX_MALE, PLAYERSEX_GAMEMASTER}, gender) == TRUE) then local playerGender = getPlayerSex(cid) if(playerGender ~= gender) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.") return TRUE end doTransformItem(item.uid, item.itemid + 1) doTeleportThing(cid, toPosition, TRUE) return TRUE end local skull = item.actionid - 180 if(skull >= 0 and skull < 6) then local playerSkull = getCreatureSkullType(cid) if(playerSkull ~= skull) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.") return TRUE end doTransformItem(item.uid, item.itemid + 1) doTeleportThing(cid, toPosition, TRUE) return TRUE end local group = item.actionid - 150 if(group >= 0 and group < 30) then local playerGroup = getPlayerGroupId(cid) if(playerGroup < group) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.") return TRUE end doTransformItem(item.uid, item.itemid + 1) doTeleportThing(cid, toPosition, TRUE) return TRUE end local vocation = item.actionid - 100 if(vocation >= 0 and vocation < 50) then local playerVocationInfo = getVocationInfo(getPlayerVocation(cid)) if(playerVocationInfo.id ~= vocation and playerVocationInfo.fromVocation ~= vocation) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.") return TRUE end doTransformItem(item.uid, item.itemid + 1) doTeleportThing(cid, toPosition, TRUE) return TRUE end if(item.actionid == 190 or (item.actionid ~= 0 and getPlayerLevel(cid) >= (item.actionid - getItemLevelDoor(item.itemid)))) then doTransformItem(item.uid, item.itemid + 1) doTeleportThing(cid, toPosition, TRUE) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.") end return TRUE end if(isInArray(specialDoors, item.itemid) == TRUE) then if(item.actionid == 100 or (item.actionid ~= 0 and getPlayerStorageValue(cid, item.actionid) > 0)) then doTransformItem(item.uid, item.itemid + 1) doTeleportThing(cid, toPosition, TRUE) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The door seems to be sealed against unwanted intruders.") end return TRUE end if(isInArray(keys, item.itemid) == TRUE) then if(itemEx.actionid > 0) then if(item.actionid == itemEx.actionid and doors[itemEx.itemid] ~= nil) then doTransformItem(itemEx.uid, doors[itemEx.itemid]) return TRUE end doPlayerSendCancel(cid, "The key does not match.") return TRUE end return FALSE end if(isInArray(horizontalOpenDoors, item.itemid) == TRUE and checkStackpos(item, fromPosition)) then local newPosition = toPosition newPosition.y = newPosition.y + 1 local doorPosition = fromPosition doorPosition.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE local doorCreature = getThingfromPos(doorPosition) if(doorCreature.itemid ~= 0) then if(getTileInfo(doorPosition).protection and not getTileInfo(newPosition).protection and doorCreature.uid ~= cid) then doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) else doTeleportThing(doorCreature.uid, newPosition, TRUE) if(isInArray(closingDoors, item.itemid) ~= TRUE) then doTransformItem(item.uid, item.itemid - 1) end end return TRUE end doTransformItem(item.uid, item.itemid - 1) return TRUE end if(isInArray(verticalOpenDoors, item.itemid) == TRUE and checkStackpos(item, fromPosition)) then local newPosition = toPosition newPosition.x = newPosition.x + 1 local doorPosition = fromPosition doorPosition.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE local doorCreature = getThingfromPos(doorPosition) if(doorCreature.itemid ~= 0) then if(getTileInfo(doorPosition).protection and not getTileInfo(newPosition).protection and doorCreature.uid ~= cid) then doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) else doTeleportThing(doorCreature.uid, newPosition, TRUE) if(isInArray(closingDoors, item.itemid) ~= TRUE) then doTransformItem(item.uid, item.itemid - 1) end end return TRUE end doTransformItem(item.uid, item.itemid - 1) return TRUE end if(doors[item.itemid] ~= nil and checkStackpos(item, fromPosition)) then if(item.actionid == 0) then doTransformItem(item.uid, doors[item.itemid]) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is locked.") end return TRUE end return FALSE end

Informação Importante

Confirmação de Termo