Ir para conteúdo
  • Cadastre-se

Posts Recomendados

  • 2 weeks later...

luanluciano93

 

A Tag correta seria esta:

 

<action itemid="XXXX" script="frag_remover.lua"/>

 

TFS 1.0.0 não lê event="script" value="

Ajudei? dá um REP +                         ↑↑

Link para o post
Compartilhar em outros sites
  • 6 months later...
  • 3 weeks later...
  • 4 months later...
  • 1 month later...
  • 2 weeks later...
  • 1 year later...
Em 25/07/2014 ás 11:33, luanluciano93 disse:

Olá pessoal, para quem não sabe esse script funciona da seguinte maneira, você escolhe um X item, e ao dar use neste X item, será removido a skull e os frags do player que usa-lo (só funciona se estiver Red Skull ou Black Skull).

 

Crie um arquivo com o nome frag_remover.lua em actions/scripts/ e coloque esse código dentro: 

TFS 1.1 e 1.2

 

Conteúdo Oculto

 

 

TFS 1.0

 

 

Conteúdo Oculto



E em actions.xml adicione a tag:


<action itemid="XXXX" script="frag_remover.lua"/>

Agora é só trocar o XXXX da tag acima pelo ID do item que será o seu Frag Remover

 

Créditos: Ninja

 

 

Bem simples né pessoal ?! Espero ter ajudado, abraços!

Opa, estou com um problema no script....se o players esta black skull(que esta configurado para ser com 12 kills)....ao usar o item ele perder a skull normal.

Porem se apos ele usar o item matar 1 player ele ja pega blackskull dnv

Link para o post
Compartilhar em outros sites
  • 1 year later...
  • 1 year later...

TFS 1.2

Lua Script Error: [Action Interface]
data/actions/scripts/frag_remover.lua:onUse
data/actions/scripts/frag_remover.lua:3: attempt to call field 'contains' (a nil value)
stack traceback:
        [C]: in function 'contains'
        data/actions/scripts/frag_remover.lua:3: in function <data/actions/scripts/frag_remover.lua:1>

anyy fixes?

function onUse(player, item, fromPosition, itemEx, toPosition, isHotkey)
local tile = Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE)
if not tile then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You must be in protection zone to use this item.")
return true
end
if isInArray({SKULL_RED, SKULL_BLACK}, player:getSkull()) then
player:setSkull(SKULL_NONE)
player:setSkullTime(0)
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Your skull has been removed!")
db.query("UPDATE `player_deaths` SET `unjustified` = 0 WHERE `unjustified` = 1 AND `killed_by` = " .. db.escapeString(player:getName()))
item:remove(1)
else
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You can only remove red or black skulls!")
player:getPosition():sendMagicEffect(CONST_ME_POFF)
end

return true
end

that script work well. Cya

Link para o post
Compartilhar em outros sites
  • 2 years later...

Nao funciona pra mim.

Ele remove a skull, porem nao remove os frags.

O player mata mais uma vez e ja pega skull black ou red denovo.

Pod eme ajudar?

 

To usando em revscript

 

Citar

local removeSkull = Action()

function removeSkull.onUse(player, item, fromPos, target, toPos, isHotkey)
    local playerPos = player:getPosition()
    local tile = Tile(playerPos)
    local fragTime = configManager.getNumber(configKeys.FRAG_TIME)
    local skullTime = player:getSkullTime()
    
    if not tile or not tile:hasFlag(TILESTATE_PROTECTIONZONE) then
        player:sendCancelMessage("You can use only in pz.")
        return true
    end

    if table.contains({SKULL_RED, SKULL_BLACK}, player:getSkull()) then
        player:setSkull(SKULL_NONE)
        player:setSkullTime(0)
        player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Your skull has been removed!")
        db.query("UPDATE `player_deaths` SET `unjustified` = 0 WHERE `unjustified` = 1 AND `killed_by` = " .. db.escapeString(player:getName()))
        item:remove(1)
    else
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You can only remove red or black skulls!")
        player:getPosition():sendMagicEffect(CONST_ME_POFF)
    end
    return true
end

removeSkull:id(37338)
removeSkull:register()

 

Link para o post
Compartilhar em outros sites

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.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.


  • Conteúdo Similar

    • Por PokemonXdemon
      [Quest System]
       
       
      Estava ontem analisando minha base, aonde tinha várias quests em arquivos separados.
      Então, pq não organizar tudo em apenas um arquivo exemplo:
      Então fiz esse script, meio simples mas útil para organizar tudo.
       
       
      Agora vamos entender oq precisamos fazer!
       
       Uma pequena atualização,  agora fica em um lugar separado a configuração para ficar mais  fácil modificar.
      Agora pode adicionar o boost que voce deseja no pokemon.
       
      Bem é isso.
    • Por Anderson Sacani
      Venho publicar uma alteração que eu e minha equipe fizemos no script já existente do Canary.
      O arquivo do script se chama quest_system1.lua.
      Fizemos essa alteração, porque o sistema original não entregava chave com actionid ao jogador. A chave vinha com o código 0000, ou seja, não abria nenhuma porta.
      A alteração que fizemos foi justamente para arrumar esse bug, por tanto, agora quando o quest ter uma chave com actionid dentro do baú, o jogador receberá essa mesma chave com o actionid definido.
       
      local specialQuests = { -- {x = 32752, y = 32343, z = 14} [52167] = Storage.DreamersChallenge.Reward, -- {x = 32806, y = 32230, z = 11} [52003] = Storage.PitsOfInferno.WeaponReward, -- {x = 32311, y = 32211, z = 8} [51400] = Storage.ThievesGuild.Reward, [51324] = Storage.WrathoftheEmperor.mainReward, -- {x = 32232, y = 31066, z = 7} [51715] = Storage.SvargrondArena.RewardGreenhorn, -- {x = 32232, y = 31059, z = 7} [51716] = Storage.SvargrondArena.RewardScrapper, -- {x = 32232, y = 31052, z = 7} [51717] = Storage.SvargrondArena.RewardWarlord } local questsExperience = { [3101] = 1 -- dummy values } local questLog = { [8213] = Storage.HiddenCityOfBeregar.DefaultStart } local tutorialIds = { [50080] = 5, [50082] = 6, [50084] = 10, [50086] = 11 } local hotaQuest = { 50950, 50951, 50952, 50953, 50954, 50955 } local questSystem1 = Action() function questSystem1.onUse(player, item, fromPosition, target, toPosition, isHotkey) local storage = specialQuests[item.actionid] if not storage then storage = item.uid if storage > 65535 then return false end end if storage == 23644 or storage == 24632 or storage == 14338 then player:setStorageValue(Storage.SvargrondArena.PitDoor, -1) end if player:getStorageValue(storage) > 0 and player:getAccountType() < ACCOUNT_TYPE_GOD then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'The ' .. ItemType(item.itemid):getName() .. ' is empty.') return true end local function copyContainer(originalContainer, newContainer) for i = 0, originalContainer:getSize() - 1 do local originalItem = originalContainer:getItem(i) local newItem = Game.createItem(originalItem.itemid, originalItem.type) newItem:setActionId(originalItem:getActionId()) newItem:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, originalItem:getAttribute(ITEM_ATTRIBUTE_DESCRIPTION)) if originalItem:isContainer() then copyContainer(Container(originalItem.uid), Container(newItem.uid)) end newContainer:addItemEx(newItem) end end local items, reward = {} local size = item:isContainer() and item:getSize() or 0 if size == 0 then local actionId = item:getActionId() reward = Game.createItem(item.itemid, item.type) reward:setActionId(actionId) reward:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, item:getAttribute(ITEM_ATTRIBUTE_DESCRIPTION)) else local container = Container(item.uid) for i = 0, container:getSize() - 1 do local originalItem = container:getItem(i) local newItem = Game.createItem(originalItem.itemid, originalItem.type) newItem:setActionId(originalItem:getActionId()) newItem:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, originalItem:getAttribute(ITEM_ATTRIBUTE_DESCRIPTION)) if originalItem:isContainer() then copyContainer(Container(originalItem.uid), Container(newItem.uid)) end items[#items + 1] = newItem end if size == 1 then reward = items[1] end end local result = '' if reward then local ret = ItemType(reward.itemid) if ret:isRune() then result = ret:getArticle() .. ' ' .. ret:getName() .. ' (' .. reward.type .. ' charges)' elseif ret:isStackable() and reward:getCount() > 1 then result = reward:getCount() .. ' ' .. ret:getPluralName() elseif ret:getArticle() ~= '' then result = ret:getArticle() .. ' ' .. ret:getName() else result = ret:getName() end else if size > 20 then reward = Game.createItem(item.itemid, 1) elseif size > 8 then reward = Game.createItem(2854, 1) else reward = Game.createItem(2853, 1) end for i = 1, size do local tmp = items[i] if reward:addItemEx(tmp) ~= RETURNVALUE_NOERROR then Spdlog.warn("[questSystem1.onUse] - Could not add quest reward to container") end end local ret = ItemType(reward.itemid) result = ret:getArticle() .. ' ' .. ret:getName() end if player:addItemEx(reward) ~= RETURNVALUE_NOERROR then local weight = reward:getWeight() if player:getFreeCapacity() < weight then player:sendCancelMessage(string.format('You have found %s weighing %.2f oz. You have no capacity.', result, (weight / 100))) else player:sendCancelMessage('You have found ' .. result .. ', but you have no room to take it.') end return true end if questsExperience[storage] then player:addExperience(questsExperience[storage], true) end if questLog[storage] then player:setStorageValue(questLog[storage], 1) end if tutorialIds[storage] then player:sendTutorial(tutorialIds[storage]) if item.uid == 50080 then player:setStorageValue(Storage.RookgaardTutorialIsland.SantiagoNpcGreetStorage, 3) end end if isInArray(hotaQuest, item.uid) then if player:getStorageValue(Storage.TheAncientTombs.DefaultStart) ~= 1 then player:setStorageValue(Storage.TheAncientTombs.DefaultStart, 1) end end player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have found ' .. result .. '.') player:setStorageValue(storage, 1) return true end for index, value in pairs(specialQuests) do questSystem1:aid(index) end questSystem1:aid(2000) questSystem1:register()  
    • Por Anderson Sacani
      local config = { scrollId = 14758, premiumDays = 30, } local days = config.premiumDays local premiumScroll = Action() function premiumScroll.onUse(player, item, fromPosition, target, toPosition, isHotkey) player:addPremiumDays(days) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Voce recebeu " .. days .. " dias de conta premium.") item:remove(1) addEvent(function() if player:isPlayer() then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "No total voce tem " .. player:getPremiumDays() .. " dias de conta premium.") end end, 2500) return true end premiumScroll:id(config.scrollId) premiumScroll:register() Percebi que alguns servidores estão vindo sem o script do premium scroll, então criei esse script para adicionar 30 dias de premium na conta do jogador que usar o premium scroll.
    • Por amoxicilina
      Action: Remover skull
       
       
    • Por ArielZeRah
      Salve, gostaria de ajuda com Função Outfits.gif em meu SCRIPT de Characters.PHP, Função que eu quero é seguinte vou deixar videio.gif abaixo pra mas informação!

      Vou deixar meu Characters.php
      characters.php 
       
      ABS; Acho que linha em questão pra editar é essa abaixo vou deixar em spooler!
       
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo