• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua [TFS] 0.4 8.60 HOW DO I GET THIS HEAL HP E MANA FOOD DON'T MESS WITH THE VOCATION FOOD INFINITE

samuel157

/root
Joined
Mar 19, 2010
Messages
447
Solutions
3
Reaction score
49
Location
São Paulo, Brazil
GitHub
Samuel10M
Lua:
local FOODS, MAX_FOOD = {
    [11130] = {18, "~|Delicia|~"}
}, 1200

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(item.itemid == 6280) then
        if(fromPosition.x == CONTAINER_POSITION) then
            fromPosition = getThingPosition(cid)
        end

        doCreatureSay(cid, getPlayerName(cid) .. " blew out the candle.", TALKTYPE_MONSTER)
        doTransformItem(item.uid, item.itemid - 1)

        doSendMagicEffect(fromPosition, CONST_ME_POFF)
        return true
    end

    local food = FOODS[item.itemid]
    if(food == nil) then
        return false
    end

    local size = food[1]
    if(getPlayerFood(cid) + size > MAX_FOOD) then
        doPlayerSendCancel(cid, "You are full.")
        return true
    end

    doPlayerFeed(cid, size)

    doCreatureSay(cid, food[2], TALKTYPE_MONSTER)
    return true
end
 
Solution
TRY:

Lua:
playerOriginalOutfit = nil
skill = nil
magic = nil
local function bloodCall (cid, times)
  if isPlayer (cid) then
    if times == 0 then
      doCreatureChangeOutfit(cid, playerOriginalOutfit)
      return true
    else
      doCreatureAddHealth(cid,(12*getCreatureMaxHealth(cid)/100)+(skill*6)+(magic*2))
      doCreatureAddMana(cid,(12*getPlayerMaxMana(cid)/100)+(skill*6)+(magic*2))
      doSendMagicEffect(getCreaturePosition(cid), 51)
      addEvent (bloodCall, 1 * 2000, cid, times - 1)
    end
  end
end

local Speed = createConditionObject(CONDITION_HASTE)
setConditionParam(Speed, CONDITION_PARAM_TICKS, 30000)
setConditionFormula(Speed, 0, 6000, 0, 6000)

function onUse(cid, item, frompos, item2, topos)

  chronos = {...
Lua:
local FOODS, MAX_FOOD = {
    [11130] = {18, "~|Delicia|~"}
}, 1200

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(item.itemid == 6280) then
        if(fromPosition.x == CONTAINER_POSITION) then
            fromPosition = getThingPosition(cid)
        end

        doCreatureSay(cid, getPlayerName(cid) .. " blew out the candle.", TALKTYPE_MONSTER)
        doTransformItem(item.uid, item.itemid - 1)

        doSendMagicEffect(fromPosition, CONST_ME_POFF)
        return true
    end

    local food = FOODS[item.itemid]
    if(food == nil) then
        return false
    end

    local size = food[1]
    if(getPlayerFood(cid) + size > MAX_FOOD) then
        doPlayerSendCancel(cid, "You are full.")
        return true
    end

    doPlayerFeed(cid, size)

    doCreatureSay(cid, food[2], TALKTYPE_MONSTER)
    return true
end
if do you want have the item infinite then delete this doTransformItem(item.uid, item.itemid - 1)
 
Lua:
local HEAL_ITEM_ID = 11130 -- ID do item que fornece a cura contínua
local HEAL_PERCENTAGE_PER_SECOND = 2 -- Porcentagem de cura por segundo (ajuste conforme necessário)
local HEAL_DURATION = 20 * 1000 -- Duração da cura em milissegundos (20 segundos)

local function startHealing(cid)
    local startTime = os.time()
    
    doCreatureSay(cid, "~|Delicia|~", TALKTYPE_MONSTER)
    doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You start to feel healed and refreshed.")
    
    local function heal()
        if isPlayer(cid) then
            local currentTime = os.time()
            local elapsedTime = currentTime - startTime
            
            if elapsedTime < HEAL_DURATION then
                local maxHealth = getMaxPlayerHealth(cid)
                local maxMana = getMaxPlayerMana(cid)
                
                local healingAmount = (maxHealth * HEAL_PERCENTAGE_PER_SECOND / 100)
                
                doPlayerAddHealth(cid, healingAmount)
                doPlayerAddMana(cid, healingAmount)
                addEvent(heal, 1000)
            end
        end
    end
    heal()
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if item.itemid == HEAL_ITEM_ID then
        startHealing(cid)
        return true
    end
    
    return false
end
or
Lua:
function onUse(cid, item, frompos, item2, topos)

    local level = getPlayerLevel(cid)
    local mlevel = getPlayerMagLevel(cid)

    local exhausted_seconds = 0.7
    local exhausted_storagevalue = 10

    local mana_minimum = 70000
    local mana_maximum = 70000

    local mana_add = math.random(mana_minimum, mana_maximum)

    if (item.type >= 1) then
        if (os.time() > getPlayerStorageValue(cid, exhausted_storagevalue)) then
            if (isPlayer(cid) == 1) then
                doSendMagicEffect(topos, 5)
                doPlayerAddMana(cid, mana_add)
                doPlayerAddHealth(cid, mana_add)
                doPlayerSay(cid, '~|Delicia|~', TALKTYPE_ORANGE_1)
                setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
            else
                doSendMagicEffect(frompos, CONST_ME_POFF)
                doPlayerSendCancel(cid, "Você está cansado.")
            end
        else
            doSendMagicEffect(frompos, CONST_ME_POFF)
            doPlayerSendCancel(cid, "You are exhausted.")
        end
    else
        if (os.time() < getPlayerStorageValue(cid, exhausted_storagevalue)) then
            doSendMagicEffect(frompos, CONST_ME_POFF)
            doPlayerSendCancel(cid, "You are exhausted.")
        else
            if (isPlayer(cid) == 1) then
                doSendMagicEffect(topos, 14)
                doPlayerAddMana(cid, mana_add)
                doPlayerAddHealth(cid, mana_add * 1.5)
                doPlayerSay(cid, "~|Delicia|~", 1)
                setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
            else
                doSendMagicEffect(frompos, CONST_ME_POFF)
                doPlayerSendCancel(cid, "You are exchausted.")
            end
        end
    end

    return 1
end
 
Lua:
function onUse(cid, item, frompos, item2, topos)

    local level = getPlayerLevel(cid)
    local mlevel = getPlayerMagLevel(cid)

    local exhausted_seconds = 0.7
    local exhausted_storagevalue = 10

    local mana_minimum = 70000
    local mana_maximum = 70000

    local mana_add = math.random(mana_minimum, mana_maximum)

    if (item.type >= 1) then
        if (os.time() > getPlayerStorageValue(cid, exhausted_storagevalue)) then
            if (isPlayer(cid) == 1) then
                doSendMagicEffect(topos, 5)
                doPlayerAddMana(cid, mana_add)
                doPlayerAddHealth(cid, mana_add)
                doPlayerSay(cid, '~|Delicia|~', TALKTYPE_ORANGE_1)
                setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
            else
                doSendMagicEffect(frompos, CONST_ME_POFF)
                doPlayerSendCancel(cid, "Você está cansado.") <--- Remove
            end
        else
            doSendMagicEffect(frompos, CONST_ME_POFF)
            doPlayerSendCancel(cid, "You are .")
        end
    else
        if (os.time() < getPlayerStorageValue(cid, exhausted_storagevalue)) then
            doSendMagicEffect(frompos, CONST_ME_POFF)
            doPlayerSendCancel(cid, "You are exhausted.") <--- Remove
        else
            if (isPlayer(cid) == 1) then
                doSendMagicEffect(topos, 14)
                doPlayerAddMana(cid, mana_add)
                doPlayerAddHealth(cid, mana_add * 1.5)
                doPlayerSay(cid, "~|Delicia|~", 1)
                setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
            else
                doSendMagicEffect(frompos, CONST_ME_POFF)
                doPlayerSendCancel(cid, "You are exchausted.") <--- Remove
            end
        end
    end

    return 1
end

how do you remove exhausted
 
Lua:
function onUse(cid, item, frompos, item2, topos)
    local level = getPlayerLevel(cid)
    local mlevel = getPlayerMagLevel(cid)

    local mana_minimum = 70000
    local mana_maximum = 70000

    local mana_add = math.random(mana_minimum, mana_maximum)

    if (item.type >= 1) then
        if (isPlayer(cid) == 1) then
            doSendMagicEffect(topos, 5)
            doPlayerAddMana(cid, mana_add)
            doPlayerAddHealth(cid, mana_add)
            doPlayerSay(cid, '~|Delicia|~', TALKTYPE_ORANGE_1)
        end
    else
        if (isPlayer(cid) == 1) then
            doSendMagicEffect(topos, 14)
            doPlayerAddMana(cid, mana_add)
            doPlayerAddHealth(cid, mana_add * 1.5)
            doPlayerSay(cid, "~|Delicia|~", 1)
        end
    end

    return 1
end
 
1- Script
Lua:
[22/09/2023 08:20:12] [Error - Action Interface]
[22/09/2023 08:20:12] data/actions/scripts/other/infinite.lua:onUse
[22/09/2023 08:20:12] Description:
[22/09/2023 08:20:12] data/actions/scripts/other/infinite.lua:17: attempt to call global 'getMaxPlayerHealth' (a nil value)
[22/09/2023 08:20:12] stack traceback:
[22/09/2023 08:20:12]     data/actions/scripts/other/infinite.lua:17: in function 'heal'
[22/09/2023 08:20:12]     data/actions/scripts/other/infinite.lua:28: in function 'startHealing'
[22/09/2023 08:20:12]     data/actions/scripts/other/infinite.lua:33: in function <data/actions/scripts/other/infinite.lua:31>

2- when of use nothing happens
 
Lua:
function onUse(cid, item, frompos, item2, topos)
    local level = getPlayerLevel(cid)
    local mlevel = getPlayerMagLevel(cid)

    local mana_minimum = 70000
    local mana_maximum = 70000

    local mana_add = math.random(mana_minimum, mana_maximum)

    if (item.type >= 1 and isPlayer(cid) == 1) then
        doSendMagicEffect(topos, 5)
        doPlayerAddMana(cid, mana_add)
        doPlayerAddHealth(cid, mana_add)
        doPlayerSay(cid, '~|Delicia|~', TALKTYPE_ORANGE_1)
    elseif (isPlayer(cid) == 1) then
        doSendMagicEffect(topos, 14)
        doPlayerAddMana(cid, mana_add)
        doPlayerAddHealth(cid, mana_add * 1.5)
        doPlayerSay(cid, "~|Delicia|~", 1)
    end

    return 1
end
 
TRY:

Lua:
playerOriginalOutfit = nil
skill = nil
magic = nil
local function bloodCall (cid, times)
  if isPlayer (cid) then
    if times == 0 then
      doCreatureChangeOutfit(cid, playerOriginalOutfit)
      return true
    else
      doCreatureAddHealth(cid,(12*getCreatureMaxHealth(cid)/100)+(skill*6)+(magic*2))
      doCreatureAddMana(cid,(12*getPlayerMaxMana(cid)/100)+(skill*6)+(magic*2))
      doSendMagicEffect(getCreaturePosition(cid), 51)
      addEvent (bloodCall, 1 * 2000, cid, times - 1)
    end
  end
end

local Speed = createConditionObject(CONDITION_HASTE)
setConditionParam(Speed, CONDITION_PARAM_TICKS, 30000)
setConditionFormula(Speed, 0, 6000, 0, 6000)

function onUse(cid, item, frompos, item2, topos)

  chronos = { lookType = 251,lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet, lookAddons = getCreatureOutfit(cid).lookAddons }
  hazus = { lookType = 194,lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet, lookAddons = getCreatureOutfit(cid).lookAddons }
  kazard = { lookType = 262,lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet, lookAddons = getCreatureOutfit(cid).lookAddons }
  skill = getPlayerSkill(cid,0)
  magic = getPlayerMagLevel(cid)
  Blood = math.random(1,3)

  -- Exhausted Settings --
  local exhausted_seconds = 0 -- Segundos que o blood vai demorar para usar denovo
  local exhausted_storagevalue = 4850 -- Storage Value do exhausted

  local exhausted_seconds2 = 0 -- How many seconds
  local exhausted_storagevalue2 = 9893 -- Storage Value

  local exhausted_seconds3 = 0 -- How many seconds
  local exhausted_storagevalue3 = 8162 -- Storage Value

  local exhausted_seconds4 = 0 -- How many seconds
  local exhausted_storagevalue4 = 6245 -- Storage Value

  local exhausted_seconds5 = 0 -- How many seconds
  local exhausted_storagevalue5 = 15555 -- Storage Value

  -- Exhausted Settings END --

  if getPlayerSoul(cid) <= 49 then
    doPlayerSendTextMessage(cid,20,'Desculpe, você não tem Souls suficiente.')
    return true
  end

  if(os.time() < getPlayerStorageValue(cid, exhausted_storagevalue)) then
    doPlayerSendTextMessage(cid,20,'Você não pode usar um blood of gods durante o efeito de outro.')
    return true
  end

  if(os.time() < getPlayerStorageValue(cid, exhausted_storagevalue2)) then
   doPlayerSendCancel(cid,"Você está muito cansado.")
   return true
  end

  if(os.time() < getPlayerStorageValue(cid, exhausted_storagevalue3)) then
    doPlayerSendCancel(cid,"Você está muito cansado.")
    return true
  end

  if(os.time() < getPlayerStorageValue(cid, exhausted_storagevalue4)) then
    doPlayerSendCancel(cid,"Está esgotado.")
    return true
  end

  if(os.time() < getPlayerStorageValue(cid, exhausted_storagevalue5)) then
    doPlayerSendCancel(cid,"Você está muito cansado.")
    return true
  end

  blood_configs = {
    [1] = {
            addHealth = 15 * getCreatureMaxHealth (cid) / 100,
            addMana = 15 * getCreatureMaxHealth (cid) / 100,
            creatureOutfit = chronos,
            creatureName = "Chronos",
            say = "~|Delicia|~!",
          },
    [2] = {
            addHealth = 10 * getCreatureMaxHealth (cid) / 100,
            addMana = 10 * getCreatureMaxHealth (cid) / 100,
            creatureOutfit = kazard,
            creatureName = "Kazard",
            say = "~|Delicia|~",
          },
    [3] = {
            addHealth =10 * getCreatureMaxHealth (cid) / 100,
            addMana = 10 * getCreatureMaxHealth (cid) / 100,
            creatureOutfit = hazus,
            creatureName = "Hazus",
            say = "~|Delicia|~",
          },
  }

  if (os.time() >= getPlayerStorageValue(cid, exhausted_storagevalue)) and (os.time() >= getPlayerStorageValue(cid, exhausted_storagevalue2)) and (os.time() >= getPlayerStorageValue(cid, exhausted_storagevalue3)) and (os.time() >= getPlayerStorageValue(cid, exhausted_storagevalue4)) then
    doCreatureAddHealth (cid, blood_configs[Blood].addHealth)
    doCreatureAddMana (cid, blood_configs[Blood].addMana)
    playerOriginalOutfit = getCreatureOutfit(cid)
    doCreatureChangeOutfit(cid, blood_configs[Blood].creatureOutfit)
    doSendMagicEffect (getCreaturePosition(cid), 12)
    doPlayerSendTextMessage (cid, 20, "Voce usou um Food e se transformou em um ".. blood_configs[Blood].creatureName .. ". (Revitalization Ativado).")
    doSendAnimatedText (getCreaturePosition(cid), blood_configs[Blood].say, TALKTYPE_ORANGE_1)
  end

  addEvent (bloodCall, 1 * 2000, cid, 15)
  setPlayerStorageValue (cid, exhausted_storagevalue, os.time() + exhausted_seconds)
  doPlayerAddSoul(cid,-50)
  doRemoveItem(item.uid,1)
  return true
end
 
Solution
Back
Top