Jump to content
  • 0

-=[TFS]=- 0.3.6 8.60 TA DANDO ESSE ERRO NA IMAGEM QUANDO EU BOTO O ATKBOOST


Muvuka

Question

 

 

TA DANDO ESSE ERRO

 

Screenshot_1.png.2101739d0a9f3148d8df3d76bf89f354.png

 

ATKBOOST

Lua:
local lvlcrit = 48904
local multiplier = 1.5

function onCombat(cid, target)
    if isPlayer(cid) and isCreature(target) then
        local criticalChance = getPlayerStorageValue(cid, lvlcrit) or 0
        local chance = math.random(1, 1000) -- Alterei para um intervalo mais razoável

        if chance <= (criticalChance * 3) then
            local damage = 100 -- Valor do dano crítico (ajuste conforme necessário)
            doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -damage, -damage, 255)
            doSendAnimatedText(getCreaturePos(target), "+BOOSTER!", 31)
           doSendMagicEffect(getCreaturePosition(cid), 54)
            return true
        end
    end
    return true
end


CRITICAL

Lua:
local lvlcrit = 48913
local multiplier = 1.5

function onCombat(cid, target)
    if isPlayer(cid) and isCreature(target) then
        local criticalChance = getPlayerStorageValue(cid, lvlcrit) or 0
        local chance = math.random(1, 1000) -- Alterei para um intervalo mais razoável

        if chance <= (criticalChance * 3) then
            local damage = 100 -- Valor do dano crítico (ajuste conforme necessário)
            doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -damage, -damage, 255)
            doSendAnimatedText(getCreaturePos(target), "DANGER!", 190)
            doSendMagicEffect(getCreaturePosition(cid), 52)
            return true
        end
    end
    return true
end
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 1

testa assim:
 

local lvlcrit = 48904
local lvlcritDanger = 48913
local multiplier = 1.5

function onCombat(cid, target)
    if isPlayer(cid) and isCreature(target) then
        local criticalChance = getPlayerStorageValue(cid, lvlcrit) or 0
        local criticalDangerChance = getPlayerStorageValue(cid, lvlcritDanger) or 0
        local chance = math.random(1, 1000) -- Mantém um intervalo razoável

        if chance <= (criticalChance * 3) then
            local damage = 100 -- Valor do dano crítico BOOSTER (ajuste conforme necessário)
            doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -damage, -damage, 255)
            doSendAnimatedText(getCreaturePos(target), "+BOOSTER!", 31)
            doSendMagicEffect(getCreaturePosition(cid), 54)
        elseif chance <= (criticalDangerChance * 3) then
            local damage = 100 -- Valor do dano crítico DANGER (ajuste conforme necessário)
            doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -damage, -damage, 255)
            doSendAnimatedText(getCreaturePos(target), "DANGER!", 190)
            doSendMagicEffect(getCreaturePosition(cid), 52)
        end
    end
    return true
end

 

Link to comment
Share on other sites

  • 0

NAO APARECE DANGER!

ACTION:

 

  local config = {
   effectonuse = 65, -- efeito que sai
   levelscrit = 100,  --- leveis que terão
   storagecrit = 48904 -- storage que será verificado
   }
   
function onUse(cid, item, frompos, item2, topos)
    if getPlayerStorageValue(cid, config.storagecrit) < config.levelscrit then
   doRemoveItem(item.uid, 1)
doSendMagicEffect(topos,config.effectonuse)
doPlayerSendTextMessage(cid,22,"You've Leveled your Critical Skill to ["..(getPlayerStorageValue(cid, config.storagecrit)+1).."/"..config.levelscrit.."].")
setPlayerStorageValue(cid, config.storagecrit, getPlayerStorageValue(cid, config.storagecrit)+1)
elseif getPlayerStorageValue(cid, config.storagecrit) >= config.levelscrit then
doPlayerSendTextMessage(cid,22,"You've already reached the MAX level of Critical Skill.\nCongratulations!!!!")
    return 0
    end
return 1
end

 

 

   local config = {
   effectonuse = 65, -- efeito que sai
   levelscrit = 100,  --- leveis que terão
   lvlcritDanger = 48913 -- storage que será verificado
   }
   
function onUse(cid, item, frompos, item2, topos)
    if getPlayerStorageValue(cid, config.lvlcritDanger) < config.levelscrit then
   doRemoveItem(item.uid, 1)
doSendMagicEffect(topos,config.effectonuse)
doPlayerSendTextMessage(cid,22,"You've Leveled your Critical Skill to ["..(getPlayerStorageValue(cid, config.lvlcritDanger)+1).."/"..config.levelscrit.."].")
setPlayerStorageValue(cid, config.lvlcritDanger, getPlayerStorageValue(cid, config.lvlcritDanger)+1)
elseif getPlayerStorageValue(cid, config.lvlcritDanger) >= config.levelscrit then
doPlayerSendTextMessage(cid,22,"You've already reached the MAX level of Critical Skill.\nCongratulations!!!!")
    return 0
    end
return 1
end

 

CREATURESCRIPT:

 

local lvlcrit = 48904
local lvlcritDanger = 48913
local multiplier = 1.5

function onCombat(cid, target)
    if isPlayer(cid) and isCreature(target) then
        local criticalChance = getPlayerStorageValue(cid, lvlcrit) or 0
        local criticalDangerChance = getPlayerStorageValue(cid, lvlcritDanger) or 0
        local chance = math.random(1, 1000) -- Mantém um intervalo razoável

        if chance <= (criticalChance * 3) then
            local damage = 100 -- Valor do dano crítico BOOSTER (ajuste conforme necessário)
            doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -damage, -damage, 255)
            doSendAnimatedText(getCreaturePos(target), "+BOOSTER!", 31)
            doSendMagicEffect(getCreaturePosition(cid), 54)
        elseif chance <= (criticalDangerChance * 3) then
            local damage = 100 -- Valor do dano crítico DANGER (ajuste conforme necessário)
            doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -damage, -damage, 255)
            doSendAnimatedText(getCreaturePos(target), "DANGER!", 190)
            doSendMagicEffect(getCreaturePosition(cid), 52)
        end
    end
    return true
end

 

Link to comment
Share on other sites

  • 0

boa noite
Script de Ação para "DANGER!"

local config = {
    effectonuse = 65, -- Efeito visual ao usar o item
    levelscrit = 100, -- Nível máximo do crítico
    lvlcritDanger = 48913 -- Storage para crítico "DANGER!"
}

function onUse(cid, item, frompos, item2, topos)
    local currentLevel = getPlayerStorageValue(cid, config.lvlcritDanger) or 0
    if currentLevel < config.levelscrit then
        doRemoveItem(item.uid, 1)
        doSendMagicEffect(topos, config.effectonuse)
        doPlayerSendTextMessage(cid, 22, "You've Leveled your Critical Skill to [" .. (currentLevel + 1) .. "/" .. config.levelscrit .. "].")
        setPlayerStorageValue(cid, config.lvlcritDanger, currentLevel + 1)
    else
        doPlayerSendTextMessage(cid, 22, "You've already reached the MAX level of Critical Skill.\nCongratulations!!!!")
        return 0
    end
    return 1
end


Script de Combate
 

local lvlcrit = 48904
local lvlcritDanger = 48913

function onCombat(cid, target)
    if isPlayer(cid) and isCreature(target) then
        local criticalChance = getPlayerStorageValue(cid, lvlcrit) or 0
        local criticalDangerChance = getPlayerStorageValue(cid, lvlcritDanger) or 0
        local chance = math.random(1, 1000) -- Mantém um intervalo razoável

        -- Verifica primeiro o crítico perigoso
        if chance <= (criticalDangerChance * 3) then
            local damage = 100 -- Valor do dano crítico "DANGER!" (ajuste conforme necessário)
            doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -damage, -damage, 255)
            doSendAnimatedText(getCreaturePos(target), "DANGER!", 190)
            doSendMagicEffect(getCreaturePosition(cid), 52)
        elseif chance <= (criticalChance * 3) then
            local damage = 100 -- Valor do dano crítico "BOOSTER" (ajuste conforme necessário)
            doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -damage, -damage, 255)
            doSendAnimatedText(getCreaturePos(target), "+BOOSTER!", 31)
            doSendMagicEffect(getCreaturePosition(cid), 54)
        end
    end
    return true
end

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...