Ir para conteúdo

Featured Replies

Postado

Boa Tarde senhores scripters, queria uma ajuda com as potions acima, pois tenho um servidor e as mesmas estão bugadas, aparece o seguinte erro no console quando sao usadas...

 

Lua Script Error: [Action Interface] 

data/actions/scripts/other/strengthening_potions.lua:onUse 
data/actions/scripts/other/strengthening_potions.lua:29: attempt to index local 'player' (a number value) 
stack traceback: 
[C]: in function '__index' 
data/actions/scripts/other/strengthening_potions.lua:29: in function 

 

 

Lua Script Error: [Action Interface] 

data/actions/scripts/other/strengthening_potions.lua:onUse 
data/actions/scripts/other/strengthening_potions.lua:35: attempt to index local 'player' (a number value) 
stack traceback: 
[C]: in function '__index' 
data/actions/scripts/other/strengthening_potions.lua:35: in function 

 

Lua Script Error: [Action Interface] 

data/actions/scripts/other/strengthening_potions.lua:onUse 
data/actions/scripts/other/strengthening_potions.lua:35: attempt to index local 'player' (a number value) 
stack traceback: 
[C]: in function '__index' 
data/actions/scripts/other/strengthening_potions.lua:35: in function

 

espero que alguem possa me ajudar, obrigado Rep ++

Postado
  • Autor

local berserker = Condition(CONDITION_ATTRIBUTES)

berserker:setParameter(CONDITION_PARAM_TICKS, 10 * 60 * 1000)
berserker:setParameter(CONDITION_PARAM_SKILL_MELEE, 5)
berserker:setParameter(CONDITION_PARAM_SKILL_SHIELD, -10)
 
local mastermind = Condition(CONDITION_ATTRIBUTES)
mastermind:setParameter(CONDITION_PARAM_TICKS, 10 * 60 * 1000)
mastermind:setParameter(CONDITION_PARAM_STAT_MAGICPOINTS, 3)
mastermind:setParameter(CONDITION_PARAM_SKILL_SHIELD, -10)
 
local bullseye = Condition(CONDITION_ATTRIBUTES)
bullseye:setParameter(CONDITION_PARAM_TICKS, 30 * 60 * 1000)
bullseye:setParameter(CONDITION_PARAM_SKILL_DISTANCE, 5)
bullseye:setParameter(CONDITION_PARAM_SKILL_SHIELD, -10)
 
local config = {
[7439] = berserker,
[7440] = mastermind,
[7443] = bullseye
}
 
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local useItem = config[item.itemid]
if not useItem then
return true
end
 
if item.itemid == 7440 then
if not player:isMage() then
player:say('Only sorcerers and druids may drink this fluid.', TALKTYPE_MONSTER_SAY)
return true
end
end
 
player:addAchievementProgress('Potion Addict', 100000)
player:addCondition(useItem)
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED)
item:remove(1)
return true
end

  • 3 months later...
Postado

tente isso:

 

local berserker = Condition(CONDITION_ATTRIBUTES)
berserker:setParameter(CONDITION_PARAM_TICKS, 10 * 60 * 1000)
berserker:setParameter(CONDITION_PARAM_SKILL_MELEE, 5)
berserker:setParameter(CONDITION_PARAM_SKILL_SHIELD, -10)
 
local mastermind = Condition(CONDITION_ATTRIBUTES)
mastermind:setParameter(CONDITION_PARAM_TICKS, 10 * 60 * 1000)
mastermind:setParameter(CONDITION_PARAM_STAT_MAGICPOINTS, 3)
mastermind:setParameter(CONDITION_PARAM_SKILL_SHIELD, -10)
 
local bullseye = Condition(CONDITION_ATTRIBUTES)
bullseye:setParameter(CONDITION_PARAM_TICKS, 30 * 60 * 1000)
bullseye:setParameter(CONDITION_PARAM_SKILL_DISTANCE, 5)
bullseye:setParameter(CONDITION_PARAM_SKILL_SHIELD, -10)
 
local config = {
        [7439] = berserker,
        [7440] = mastermind,
        [7443] = bullseye
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
        local useItem = config[item.itemid]
        if not useItem then
           return true
        end
 
        local player = Player(cid)
        local vocations = {1, 2, 5, 6}
        if item.itemid == 7440 then
            if not isInArray(vocations, player:getVocation():getBase():getId()) then
                doPlayerSendTextMessage(cid, 18 ,'Only sorcerers and druids may drink this fluid.', TALKTYPE_MONSTER_SAY)
               return true
            end
        end
 
        local cStorage = player:getStorageValue(Storage.Achievements.PotionAddict)
        if cStorage < 100000 then
            player:setStorageValue(Storage.Achievements.PotionAddict, math.max(1, cStorage) + 1)
        elseif cStorage == 100000 then
            player:addAchievement('Potion Addict')
            player:setStorageValue(Storage.Achievements.PotionAddict, 100001)
        end
 
        player:addCondition(useItem)
        player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED)
        Item(item.uid):remove(1)
        return true
end

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

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo