Lua Displaying amount that potions gives

liqeen

Member
Joined
Nov 26, 2014
Messages
55
Reaction score
3
Hello i need some help with that script
How do i add here a function that will show for how much the player is manasing? I mean the purple amount over the player everytime he uses the potion
Code:
-- =============================================================================================================================================================== --
-- ===================    CREATED BY [email protected] CREDITS TO OTLAND FOR HELPING ME TO LEARN EVERY KIND OF CODING USED IN THIS SCRIPT ====================== --
-- =============================================================================================================================================================== --
local config = {
lvl = 0.3, -- the multiplier for how much level matters. Default 1.
mlvl = 0, -- the mulitplier for how much mlvl matters. Default 1.
forMin = 0.2, -- forumula multiplier for MIN/max range. Default 0.9 == 90%          --Change both to 1.0 for amount healed to have no min/max
forMax = 0.3, -- forumula multiplier for min/MAX range. Default 0.9 == 110%          --Change both to 1.0 for amount healed to have no min/max
removeOnUse = false, -- Does this remove 1 potion after it's use? true/false          -- Default true.
useOnSummons = true, -- Can you use this on a players summon? true/false              -- Default true.
useOnGuildSummon = true, -- Can you use this on guild mate's summon? true/false      -- Default true.
useOnPartySummon = true, -- Can you use this on a party members summon? true/false      -- Default true.
realPvpMode = false, -- True = Players can't use potions for hotkeys || False = Players are allowed to use potions for hotkeys.
exhaust = Condition(CONDITION_EXHAUST_HEAL, CONDITIONID_HEAD), --Condition for each specific potion.Adjust time in potions table below.
cooldown =  Condition(CONDITION_SPELLCOOLDOWN, CONDITIONID_HEAD) -- Condition for creating "groups" of potions with same cooldown time, eg. all mana potions.
}
local POTIONS = {
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  [8704] = {empty = 7636, spellid = 1, splash = 2, exhaust = 0, health = true, mana = false, healthpercent = 8},                                                                         -- small health potion
  [7618] = {empty = 7636, spellid = 1, splash = 2, exhaust = 0, health = true, mana = false, healthpercent = 12},                                                                        -- health potion
  [7588] = {empty = 7634, spellid = 2, splash = 2, exhaust = 0, health = true, mana = false, healthpercent = 25, lvlReq = 50, vocations = {1, 3, 4, 7, 8, 12}},                            -- strong health potion
  [7591] = {empty = 7635, spellid = 2, splash = 2, exhaust = 0, health = true, mana = false, healthpercent = 40, lvlReq = 80, vocations = {4, 8, 12}},                                     -- great health potion
  [8473] = {empty = 7635, spellid = 2, splash = 2, exhaust = 0, health = true, mana = false, healthpercent = 60, lvlReq = 150, vocations = {4, 8, 12}},                                     -- ultimate health potion
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  [7620] = {empty = 7636, spellid = 3, splash = 7, exhaust = 0, health = false, mana = true, manapercent = 12},                                                                             -- mana potion
  [7589] = {empty = 7634, spellid = 3, splash = 7, exhaust = 0, health = false, mana = true, manapercent = 25, lvlReq = 50, vocations = {1, 2, 3, 5, 6, 7, 9, 10, 11}},                     -- strong mana potion
  [7590] = {empty = 7635, spellid = 3, splash = 7, exhaust = 0, health = false, mana = true, manapercent = 40, lvlReq = 80, vocations = {1, 2, 5, 6, 9, 10}},                             -- great mana potion
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  [8472] = {empty = 7635, spellid = 2, splash = 3, exhaust = 0, health = true,  mana = true, healthpercent = 60, manapercent = 60, lvlReq = 100, vocations = {3, 7, 11}}                     -- great spirit potion
}
------Below for Advanced Users Only----------
function Player:isCreatureFriend(creature)
    local PID
    local GID
      if self:getParty() then
        PID = self:getParty():getId()
      end
      if self:getGuild() then
        GID = self:getGuild():getId()
      end
     if creature:isPlayer() then
        if creature:getParty() then
            if creature:getParty():getId() == PID then
                return true
            end
        end
        if creature:getGuild() then
            if creature:getGuild():getId() == GID then
                  return true
            end
        end
        return false
    end
    if creature:isMonster() then
    local master = creature:getMaster()
        if master then
            if master:getId() == self:getId() then
                return true
            end
            if master:getParty() and master:getParty():getId() == PID then
                return true
            end
            if master:getGuild() and master:getGuild():getId() == GID then
                return true
            end
            return false
        end
    end
end

function onUse(caster, item, castPos, target, toPosition, isHotkey)
local potion = POTIONS[item.itemid]
local health = potion.health
local mana = potion.mana
local hpPercent = potion.healthpercent
local mpPercent = potion.manapercent
local exhaust = config.exhaust
local cooldown = config.cooldown
local mlevel = caster:getMagicLevel()
local level = caster:getLevel()
    if(not potion) then
        return false
    end
    if isHotkey and config.realPvpMode == true then
        caster:getPosition():sendMagicEffect(CONST_ME_POFF)
        return caster:sendTextMessage(MESSAGE_INFO_DESCR,"Hotkey use is disabled for potions!")
    end
    if toPosition.z == 0 or nil then
        caster:getPosition():sendMagicEffect(CONST_ME_POFF)
        return caster:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE)
    end
    if toPosition.x == 65535 or nil then
        caster:getPosition():sendMagicEffect(CONST_ME_POFF)
        return caster:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE)
    end

    if target:isItem() then
        if (not target:hasProperty()) then
            Item(doCreateItem(2016, potion.splash, toPosition)):decay()
                if config.removeOnUse and not caster:getGroup():getAccess() then
                    Item(item.uid):remove(1)
                end
            return true
        end
        caster:getPosition():sendMagicEffect(CONST_ME_POFF)
        return caster:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE)
    end
    local healthmax = target:getMaxHealth()
    local manamax = target:getMaxMana()
    if caster:getCondition(CONDITION_EXHAUST_HEAL, CONDITIONID_HEAD, potion.spellid) then
        caster:getPosition():sendMagicEffect(CONST_ME_POFF)
        return caster:sendCancelMessage(RETURNVALUE_YOUAREEXHAUSTED)
    end
    if (potion.vocations) and  (not caster:getGroup():getAccess()) then
        if (not isInArray(potion.vocations, caster:getVocation():getId())) then
            caster:getPosition():sendMagicEffect(CONST_ME_POFF)
            return caster:sendTextMessage(MESSAGE_INFO_DESCR,"Your vocation may not use this fluid")
        end
    end
    if((potion.lvlReq and caster:getLevel() < potion.lvlReq) and not caster:getGroup():getAccess()) then
        caster:getPosition():sendMagicEffect(CONST_ME_POFF)
        return caster:sendTextMessage(MESSAGE_INFO_DESCR,"Only players of " ..potion.level.. " or above may use this fluid.")
    end
    if target:isPlayer() then
        if health == true then
            target:addHealth(( math.random((((healthmax/100)*hpPercent ) + ((level/12)*config.lvl ) + ((mlevel/18)*config.mlvl ))*config.forMin, ((((healthmax/100)*hpPercent ) + ((level/12)*config.lvl )+ ((mlevel/18))*config.mlvl )*config.forMax))))
        end
        if mana == true then
            target:addMana(( math.random((((manamax/100)*mpPercent ) + ((level/18)*config.lvl ) + ((mlevel/12)*config.mlvl ))*config.forMin, ((((manamax/100)*mpPercent ) + ((level/18)*config.lvl )+ ((mlevel/12))*config.mlvl )*config.forMax))))
        end
    end
    if target:isMonster() then
    local monsterMaster = target:getMaster()
        if caster:isCreatureFriend(target) then
            if config.useOnSummons == true then
                if health then
                    target:addHealth(( math.random((((healthmax/100)*hpPercent ) + ((level/12)*config.lvl ) + ((mlevel/18)*config.mlvl ))*config.forMin, ((((healthmax/100)*hpPercent ) + ((level/12)*config.lvl )+ ((mlevel/18))*config.mlvl )*config.forMax))))
                else
                    caster:getPosition():sendMagicEffect(CONST_ME_POFF)
                    return caster:sendTextMessage(MESSAGE_STATUS_SMALL,"Summons don't use mana!")
                end
            else
                caster:getPosition():sendMagicEffect(CONST_ME_POFF)
                return caster:sendTextMessage(MESSAGE_STATUS_SMALL,"You can't use this on summons!")
            end
        else
            caster:getPosition():sendMagicEffect(CONST_ME_POFF)
            return caster:sendTextMessage(MESSAGE_STATUS_SMALL,"You can't use this on that creature!")
        end
    end      
    if target:isNpc() then
        caster:getPosition():sendMagicEffect(CONST_ME_POFF)
        return caster:sendTextMessage(MESSAGE_STATUS_SMALL,"You can't use this on that creature!")
    end
    if config.removeOnUse and not caster:getGroup():getAccess() then
        Item(item.uid):remove(1)
    end
    exhaust:setParameter(CONDITION_PARAM_TICKS, potion.exhaust)
    exhaust:setParameter(CONDITION_PARAM_SUBID, potion.spellid)
    cooldown:setParameter(CONDITION_PARAM_TICKS, potion.exhaust)
    cooldown:setParameter(CONDITION_PARAM_SUBID, potion.spellid)
    caster:addCondition(cooldown)
    caster:addCondition(exhaust)
    target:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
    doCreatureSayWithRadius(target, 'Aaaah...', TALKTYPE_MONSTER_SAY, 2, 2)
  return true
end
 

Acubens

Old Penguin
Joined
May 6, 2008
Messages
973
Reaction score
70
Location
Venezuela
PHP:
-- =============================================================================================================================================================== --
-- ===================    CREATED BY [email protected] CREDITS TO OTLAND FOR HELPING ME TO LEARN EVERY KIND OF CODING USED IN THIS SCRIPT ====================== --
-- =============================================================================================================================================================== --
local config = {
lvl = 0.3, -- the multiplier for how much level matters. Default 1.
mlvl = 0, -- the mulitplier for how much mlvl matters. Default 1.
forMin = 0.2, -- forumula multiplier for MIN/max range. Default 0.9 == 90%          --Change both to 1.0 for amount healed to have no min/max
forMax = 0.3, -- forumula multiplier for min/MAX range. Default 0.9 == 110%          --Change both to 1.0 for amount healed to have no min/max
removeOnUse = false, -- Does this remove 1 potion after it's use? true/false          -- Default true.
useOnSummons = true, -- Can you use this on a players summon? true/false              -- Default true.
useOnGuildSummon = true, -- Can you use this on guild mate's summon? true/false      -- Default true.
useOnPartySummon = true, -- Can you use this on a party members summon? true/false      -- Default true.
realPvpMode = false, -- True = Players can't use potions for hotkeys || False = Players are allowed to use potions for hotkeys.
exhaust = Condition(CONDITION_EXHAUST_HEAL, CONDITIONID_HEAD), --Condition for each specific potion.Adjust time in potions table below.
cooldown =  Condition(CONDITION_SPELLCOOLDOWN, CONDITIONID_HEAD) -- Condition for creating "groups" of potions with same cooldown time, eg. all mana potions.
}
local POTIONS = {
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  [8704] = {empty = 7636, spellid = 1, splash = 2, exhaust = 0, health = true, mana = false, healthpercent = 8},                                                                         -- small health potion
  [7618] = {empty = 7636, spellid = 1, splash = 2, exhaust = 0, health = true, mana = false, healthpercent = 12},                                                                        -- health potion
  [7588] = {empty = 7634, spellid = 2, splash = 2, exhaust = 0, health = true, mana = false, healthpercent = 25, lvlReq = 50, vocations = {1, 3, 4, 7, 8, 12}},                            -- strong health potion
  [7591] = {empty = 7635, spellid = 2, splash = 2, exhaust = 0, health = true, mana = false, healthpercent = 40, lvlReq = 80, vocations = {4, 8, 12}},                                     -- great health potion
  [8473] = {empty = 7635, spellid = 2, splash = 2, exhaust = 0, health = true, mana = false, healthpercent = 60, lvlReq = 150, vocations = {4, 8, 12}},                                     -- ultimate health potion
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  [7620] = {empty = 7636, spellid = 3, splash = 7, exhaust = 0, health = false, mana = true, manapercent = 12},                                                                             -- mana potion
  [7589] = {empty = 7634, spellid = 3, splash = 7, exhaust = 0, health = false, mana = true, manapercent = 25, lvlReq = 50, vocations = {1, 2, 3, 5, 6, 7, 9, 10, 11}},                     -- strong mana potion
  [7590] = {empty = 7635, spellid = 3, splash = 7, exhaust = 0, health = false, mana = true, manapercent = 40, lvlReq = 80, vocations = {1, 2, 5, 6, 9, 10}},                             -- great mana potion
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  [8472] = {empty = 7635, spellid = 2, splash = 3, exhaust = 0, health = true,  mana = true, healthpercent = 60, manapercent = 60, lvlReq = 100, vocations = {3, 7, 11}}                     -- great spirit potion
}
------Below for Advanced Users Only----------
function Player:isCreatureFriend(creature)
    local PID
    local GID
      if self:getParty() then
        PID = self:getParty():getId()
      end
      if self:getGuild() then
        GID = self:getGuild():getId()
      end
     if creature:isPlayer() then
        if creature:getParty() then
            if creature:getParty():getId() == PID then
                return true
            end
        end
        if creature:getGuild() then
            if creature:getGuild():getId() == GID then
                  return true
            end
        end
        return false
    end
    if creature:isMonster() then
    local master = creature:getMaster()
        if master then
            if master:getId() == self:getId() then
                return true
            end
            if master:getParty() and master:getParty():getId() == PID then
                return true
            end
            if master:getGuild() and master:getGuild():getId() == GID then
                return true
            end
            return false
        end
    end
end

function onUse(caster, item, castPos, target, toPosition, isHotkey)
local potion = POTIONS[item.itemid]
local health = potion.health
local mana = potion.mana
local hpPercent = potion.healthpercent
local mpPercent = potion.manapercent
local exhaust = config.exhaust
local cooldown = config.cooldown
local mlevel = caster:getMagicLevel()
local level = caster:getLevel()
    if(not potion) then
        return false
    end
    if isHotkey and config.realPvpMode == true then
        caster:getPosition():sendMagicEffect(CONST_ME_POFF)
        return caster:sendTextMessage(MESSAGE_INFO_DESCR,"Hotkey use is disabled for potions!")
    end
    if toPosition.z == 0 or nil then
        caster:getPosition():sendMagicEffect(CONST_ME_POFF)
        return caster:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE)
    end
    if toPosition.x == 65535 or nil then
        caster:getPosition():sendMagicEffect(CONST_ME_POFF)
        return caster:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE)
    end

    if target:isItem() then
        if (not target:hasProperty()) then
            Item(doCreateItem(2016, potion.splash, toPosition)):decay()
                if config.removeOnUse and not caster:getGroup():getAccess() then
                    Item(item.uid):remove(1)
                end
            return true
        end
        caster:getPosition():sendMagicEffect(CONST_ME_POFF)
        return caster:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE)
    end
    local healthmax = target:getMaxHealth()
    local manamax = target:getMaxMana()
    if caster:getCondition(CONDITION_EXHAUST_HEAL, CONDITIONID_HEAD, potion.spellid) then
        caster:getPosition():sendMagicEffect(CONST_ME_POFF)
        return caster:sendCancelMessage(RETURNVALUE_YOUAREEXHAUSTED)
    end
    if (potion.vocations) and  (not caster:getGroup():getAccess()) then
        if (not isInArray(potion.vocations, caster:getVocation():getId())) then
            caster:getPosition():sendMagicEffect(CONST_ME_POFF)
            return caster:sendTextMessage(MESSAGE_INFO_DESCR,"Your vocation may not use this fluid")
        end
    end
    if((potion.lvlReq and caster:getLevel() < potion.lvlReq) and not caster:getGroup():getAccess()) then
        caster:getPosition():sendMagicEffect(CONST_ME_POFF)
        return caster:sendTextMessage(MESSAGE_INFO_DESCR,"Only players of " ..potion.level.. " or above may use this fluid.")
    end
    if target:isPlayer() then
        if health == true then
            target:addHealth(( math.random((((healthmax/100)*hpPercent ) + ((level/12)*config.lvl ) + ((mlevel/18)*config.mlvl ))*config.forMin, ((((healthmax/100)*hpPercent ) + ((level/12)*config.lvl )+ ((mlevel/18))*config.mlvl )*config.forMax))))
        end
        if mana == true then
            local manaToAdd = (math.random((((manamax/100)*mpPercent ) + ((level/18)*config.lvl ) + ((mlevel/12)*config.mlvl ))*config.forMin, ((((manamax/100)*mpPercent ) + ((level/18)*config.lvl )+ ((mlevel/12))*config.mlvl )*config.forMax)))
            target:addMana(manaToAdd)
            doPlayerSendTextMessage(cid, MESSAGE_EXPERIENCE, "", target:getPosition(), manaToAdd, TEXTCOLOR_PURPLE)
        end
    end
    if target:isMonster() then
    local monsterMaster = target:getMaster()
        if caster:isCreatureFriend(target) then
            if config.useOnSummons == true then
                if health then
                    target:addHealth(( math.random((((healthmax/100)*hpPercent ) + ((level/12)*config.lvl ) + ((mlevel/18)*config.mlvl ))*config.forMin, ((((healthmax/100)*hpPercent ) + ((level/12)*config.lvl )+ ((mlevel/18))*config.mlvl )*config.forMax))))
                else
                    caster:getPosition():sendMagicEffect(CONST_ME_POFF)
                    return caster:sendTextMessage(MESSAGE_STATUS_SMALL,"Summons don't use mana!")
                end
            else
                caster:getPosition():sendMagicEffect(CONST_ME_POFF)
                return caster:sendTextMessage(MESSAGE_STATUS_SMALL,"You can't use this on summons!")
            end
        else
            caster:getPosition():sendMagicEffect(CONST_ME_POFF)
            return caster:sendTextMessage(MESSAGE_STATUS_SMALL,"You can't use this on that creature!")
        end
    end     
    if target:isNpc() then
        caster:getPosition():sendMagicEffect(CONST_ME_POFF)
        return caster:sendTextMessage(MESSAGE_STATUS_SMALL,"You can't use this on that creature!")
    end
    if config.removeOnUse and not caster:getGroup():getAccess() then
        Item(item.uid):remove(1)
    end
    exhaust:setParameter(CONDITION_PARAM_TICKS, potion.exhaust)
    exhaust:setParameter(CONDITION_PARAM_SUBID, potion.spellid)
    cooldown:setParameter(CONDITION_PARAM_TICKS, potion.exhaust)
    cooldown:setParameter(CONDITION_PARAM_SUBID, potion.spellid)
    caster:addCondition(cooldown)
    caster:addCondition(exhaust)
    target:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
    doCreatureSayWithRadius(target, 'Aaaah...', TALKTYPE_MONSTER_SAY, 2, 2)
  return true
end
Test it.
 

Danger II

FluppiX.com
Joined
Nov 21, 2012
Messages
1,578
Reaction score
368
Location
Germany
Guess he is using meta
Put this at the top of the script:
Lua:
function Position.sendMessage(self, message, talktype)
    local specs = Game.getSpectators(self, false, true, 7, 7, 5, 5)
    if #specs > 0 then
        for i = 1, #specs do
            local player = specs[i]
            player:say(message, talktype or TALKTYPE_MONSTER_SAY, false, player, self)
        end
    end
end
Replace (as written above):
Lua:
doPlayerSendTextMessage(cid, MESSAGE_EXPERIENCE, "", target:getPosition(), manaToAdd, TEXTCOLOR_PURPLE)
With:
Lua:
target:getPosition():sendMessage(manaToAdd)

Or, if your server still supports sendAnimatedText
Lua:
doSendAnimatedText(target:getPosition(),  manaToAdd, TEXTCOLOR_PURPLE)
 
OP
L

liqeen

Member
Joined
Nov 26, 2014
Messages
55
Reaction score
3
Guess he is using meta
Put this at the top of the script:
Lua:
function Position.sendMessage(self, message, talktype)
    local specs = Game.getSpectators(self, false, true, 7, 7, 5, 5)
    if #specs > 0 then
        for i = 1, #specs do
            local player = specs[i]
            player:say(message, talktype or TALKTYPE_MONSTER_SAY, false, player, self)
        end
    end
end
Replace (as written above):
Lua:
doPlayerSendTextMessage(cid, MESSAGE_EXPERIENCE, "", target:getPosition(), manaToAdd, TEXTCOLOR_PURPLE)
With:
Lua:
target:getPosition():sendMessage(manaToAdd)

Or, if your server still supports sendAnimatedText
Lua:
doSendAnimatedText(target:getPosition(),  manaToAdd, TEXTCOLOR_PURPLE)
It works but not exatcly :D If i put that in script
Code:
target:getPosition():sendMessage(manaToAdd)
it sends like this
Screenshot - d3834714a5664c7f581c3477f8bcb411 - Gyazo
And if i replace it with
Code:
doSendAnimatedText(target:getPosition(),  manaToAdd, TEXTCOLOR_PURPLE)
then i get this bug in console
LuaScriptInterface::luaDebugPrint<>. Deprecated function.
stack traceback:
[C]: in function 'debugPrint'
data/lib/compat/compat.lua:406: in function 'doSendAnimatedText'
 

Mr Trala

Active Member
Joined
Aug 26, 2014
Messages
148
Reaction score
92
Location
Mexico
Before:
Lua:
target:addMana(manaToAdd)
Add:
Lua:
local total = math.floor(manaToAdd)
Change:
Lua:
target:getPosition():sendMessage(manaToAdd)
To:
Lua:
target:getPosition():sendMessage("+"..total.."")
Change
Lua:
 target:addMana(manaToAdd)
To:
Lua:
target:addMana(total)
 
OP
L

liqeen

Member
Joined
Nov 26, 2014
Messages
55
Reaction score
3
It works but not exatcly :D If i put target:getPosition():sendMessage(manaToAdd) it sends like this
Screenshot - d3834714a5664c7f581c3477f8bcb411 - Gyazo
And if i replace it with doSendAnimatedText(target:getPosition(), manaToAdd, TEXTCOLOR_PURPLE) then i get this bug in console
LuaScriptInterface::luaDebugPrint<>. Deprecated function.
stack traceback:
[C]: in function 'debugPrint'
Before:
Lua:
target:addMana(manaToAdd)
Add:
Lua:
local total = math.floor(manaToAdd)
Change:
Lua:
target:getPosition():sendMessage(manaToAdd)
To:
Lua:
target:getPosition():sendMessage("+"..total.."")
Change
Lua:
 target:addMana(manaToAdd)
To:
Lua:
target:addMana(total)
data/lib/compat/compat.lua:406: in function 'doSendAnimatedText'
Works perfectly but how can I change the colour? I mean it is same colour as "Aaaaah.." is.
 

Danger II

FluppiX.com
Joined
Nov 21, 2012
Messages
1,578
Reaction score
368
Location
Germany
Change:
Lua:
target:getPosition():sendMessage(manaToAdd)
To: (if you changed manaToAdd to total, remember to replace it)
Lua:
doCreatureSayWithRadius(target, manaToAdd, TALKTYPE_MONSTER_SAY, 2, 2)
 
OP
L

liqeen

Member
Joined
Nov 26, 2014
Messages
55
Reaction score
3
Change:
Lua:
target:getPosition():sendMessage(manaToAdd)
To: (if you changed manaToAdd to total, remember to replace it)
Lua:
doCreatureSayWithRadius(target, manaToAdd, TALKTYPE_MONSTER_SAY, 2, 2)
Well i changed it and it looks exatcly same as this below, even if i changed the numbers.
Code:
target:getPosition():sendMessage(manaToAdd)
 

Mr Trala

Active Member
Joined
Aug 26, 2014
Messages
148
Reaction score
92
Location
Mexico
Not sure what's the last problem, you said that you want it the same color as "Aaaaah"? Is exactly the same color as of right now
 
OP
L

liqeen

Member
Joined
Nov 26, 2014
Messages
55
Reaction score
3
Not sure what's the last problem, you said that you want it the same colour as "Aaaaah"? Is exactly the same colour as of right now
I meant I wanted a different colour: D I want to change the colour of the amount that is over the player when he is using the mana potion because for now, it merges with Aaaaah

for example
'Aaaah' - Orange
'Mana potion using' - Purple
 

Stigma

Veteran OT User
Joined
Feb 14, 2015
Messages
4,370
Reaction score
1,955
you cant change the color of the text after client 9.6~
 

2Rec

Veteran OT User
Joined
Jul 31, 2013
Messages
510
Reaction score
621
Try
Lua:
target:sendTextMessage(MESSAGE_HEALED, 'Youve regained ' ..  manaToAdd .. ' mana points.', player:getPosition(), manaToAdd,  TEXTCOLOR_SKYBLUE)
 
Last edited:
OP
L

liqeen

Member
Joined
Nov 26, 2014
Messages
55
Reaction score
3
Try
Lua:
player:sendTextMessage(MESSAGE_HEALED, 'Youve regained ' ..  manaToAdd .. ' mana points.', player:getPosition(), manaToAdd,  TEXTCOLOR_SKYBLUE)
"Attempt to index global 'player' a nil value"
Not working : S

Vulcan_ i can not agree with you for example on hexera when u use mana potion it shows how much u just get from potion

Screenshot - 4a4b8e70ff037b046a4149e772e5b6ec - Gyazo - Just look at it, it merges soo much
 
Last edited:

2Rec

Veteran OT User
Joined
Jul 31, 2013
Messages
510
Reaction score
621
"Attempt to index global 'player' a nil value"
Not working : S

Vulcan_ i can not agree with you for example on hexera when u use mana potion it shows how much u just get from potion

Screenshot - 4a4b8e70ff037b046a4149e772e5b6ec - Gyazo - Just look at it, it merges soo much
Change to target.

Is it one message that says both mana and 'Aaah'?
 
Last edited:
Top