• 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!

Linux Text in MR? Tfs 0.4 HELP!

TibiaFX

******************
Joined
Jul 23, 2014
Messages
335
Reaction score
61
Can someone add for me in the script a text thing also if I use mr it should say "Epic Manarune"


local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 0) -- time in seconds x1000

function onUse(cid, item, fromPosition, itemEx, toPosition)

local manamax = getPlayerMaxMana(cid)
local min = 23
local max = 23
local mana_add = math.random((manamax * (min/100)), (manamax * (max/100)))

if(hasCondition(cid, CONDITION_EXHAUST)) then
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
doPlayerSendCancel(cid, "You are exhausted")
return true
end
local pos = getThingPos(cid)
doPlayerAddMana(cid, mana_add)
doSendMagicEffect(getThingPos(cid), CONST_ME_HOLYAREA)
doSendAnimatedText(getPlayerPosition(cid),"+"..mana_add.."", TEXTCOLOR_YELLOW)
doAddCondition(cid, exhaust)
return true
end


I hope someone can help me ^^
 
1st off always place the code in code tags, 2nd explain the question so we can understand exactly what you want, you honestly can't tell us your description makes any real sense or describes anything meaningful?
 
Change this line:
Code:
doSendAnimatedText(getPlayerPosition(cid),"+"..mana_add.."", TEXTCOLOR_YELLOW)
To:
Code:
doSendAnimatedText(getPlayerPosition(cid),"TEXT HERE", TEXTCOLOR_YELLOW)

And as Codex says, use code tags.
Just a tip from me is learn some basic lua before begining to launch a server, i made the same misstake in the beginning
 
2015-10-0_shnxqrx.png
 
This comment was unnecessary, help him to learn instead

True :SSS Ah I will try out if your script works, if it works "thanks man" xD


What you mean with "Not developer" and "Not soon" ?

Sorry for double post, @Himii the problem is, theres the text now but ppls cant see anymore their heal ^^
 
Last edited by a moderator:
Code:
    local c = {
        manaMax = 0,
        min = 23,
        max = 23,
        addMana = 0,
        pos = {},
        animatedText = {
            text = "Epic Manarune",
            color = TEXTCOLOR_YELLOW
        }
    }
    local exhaust = createConditionObject(CONDITION_EXHAUST)
    setConditionParam(exhaust, CONDITION_PARAM_TICKS, 0) -- time in seconds x1000

    function onUse(cid, item, fromPosition, itemEx, toPosition)
        c.manaMax = getPlayerMaxMana(cid)
        c.addMana = math.random((c.manaMax * (c.min/100)), (c.manaMax * (c.max/100)))
        c.pos = getThingPos(cid)
        if(hasCondition(cid, CONDITION_EXHAUST)) then
            doSendMagicEffect(c.pos, CONST_ME_POFF)
            doPlayerSendCancel(cid, "You are exhausted")
            return false
        end
        doPlayerAddMana(cid, c.addMana)
        doSendMagicEffect(c.pos, CONST_ME_HOLYAREA)
        doSendAnimatedText(c.pos, "+"..(c.addMana).." "..(c.animatedText.text), c.animatedText.color)
        doAddCondition(cid, exhaust)
        return true
    end
 
local c = { manaMax = 0, min = 23, max = 23, addMana = 0, pos = {}, animatedText = { text = "Epic Manarune", color = TEXTCOLOR_YELLOW } } local exhaust = createConditionObject(CONDITION_EXHAUST) setConditionParam(exhaust, CONDITION_PARAM_TICKS, 0) -- time in seconds x1000 function onUse(cid, item, fromPosition, itemEx, toPosition) c.manaMax = getPlayerMaxMana(cid) c.addMana = math.random((c.manaMax * (c.min/100)), (c.manaMax * (c.max/100))) c.pos = getThingPos(cid) if(hasCondition(cid, CONDITION_EXHAUST)) then doSendMagicEffect(c.pos, CONST_ME_POFF) doPlayerSendCancel(cid, "You are exhausted") return false end doPlayerAddMana(cid, c.addMana) doSendMagicEffect(c.pos, CONST_ME_HOLYAREA) doSendAnimatedText(c.pos, "+"..(c.addMana).." "..(c.animatedText.text), c.animatedText.color) doAddCondition(cid, exhaust) return true end

Dont works ^^
 
Ah sorry, also it show just the heal but not the text about the error, cant check atm ^^
Its because animated text only supports soo many characters, after it has reached its limit it will truncate the rest of the letters.
 
What you mean with "Not developer" and "Not soon" ?
I apologize for my idiotic behaviour, had really bad day, i am sorry.

Here is script that should show all animated info you need.
Code:
    local c = {
        manaMax = 0,
        min = 23,
        max = 23,
        addMana = 0,
        pos = {},
        animatedText = {
            text = "Epic Manarune",
            color = TEXTCOLOR_YELLOW
        }
    }
    local exhaust = createConditionObject(CONDITION_EXHAUST)
    setConditionParam(exhaust, CONDITION_PARAM_TICKS, 0) -- time in seconds x1000

    function onUse(cid, item, fromPosition, itemEx, toPosition)
        c.manaMax = getPlayerMaxMana(cid)
        c.addMana = math.random((c.manaMax * (c.min/100)), (c.manaMax * (c.max/100)))
        c.pos = getThingPos(cid)
        if(hasCondition(cid, CONDITION_EXHAUST)) then
            doSendMagicEffect(c.pos, CONST_ME_POFF)
            doPlayerSendCancel(cid, "You are exhausted")
            return false
        end
        doPlayerAddMana(cid, c.addMana)
        doSendMagicEffect(c.pos, CONST_ME_HOLYAREA)
        doSendAnimatedText(c.pos, "+"..(c.addMana).."")
        doSendAnimatedText(c.pos, ""..(c.animatedText.text), c.animatedText.color)
        doAddCondition(cid, exhaust)
        return true
    end
 
I apologize for my idiotic behaviour, had really bad day, i am sorry.

Here is script that should show all animated info you need.
Code:
    local c = {
        manaMax = 0,
        min = 23,
        max = 23,
        addMana = 0,
        pos = {},
        animatedText = {
            text = "Epic Manarune",
            color = TEXTCOLOR_YELLOW
        }
    }
    local exhaust = createConditionObject(CONDITION_EXHAUST)
    setConditionParam(exhaust, CONDITION_PARAM_TICKS, 0) -- time in seconds x1000

    function onUse(cid, item, fromPosition, itemEx, toPosition)
        c.manaMax = getPlayerMaxMana(cid)
        c.addMana = math.random((c.manaMax * (c.min/100)), (c.manaMax * (c.max/100)))
        c.pos = getThingPos(cid)
        if(hasCondition(cid, CONDITION_EXHAUST)) then
            doSendMagicEffect(c.pos, CONST_ME_POFF)
            doPlayerSendCancel(cid, "You are exhausted")
            return false
        end
        doPlayerAddMana(cid, c.addMana)
        doSendMagicEffect(c.pos, CONST_ME_HOLYAREA)
        doSendAnimatedText(c.pos, "+"..(c.addMana).."")
        doSendAnimatedText(c.pos, ""..(c.animatedText.text), c.animatedText.color)
        doAddCondition(cid, exhaust)
        return true
    end

Haha its fine, ah the script dont works- first of all, it dont show the text + the heal got a another color now ^^
 
Here is the function I wrote which will animate all of the text even if it is a huge paragraph only catch is it breaks up the words.
Code:
    function doAnimatedAllText(pos, text, color)
        local textTable = {}
        text:gsub("[0-9a-zA-Z]+", function(str) table.insert(textTable, str) end)
        for i in ipairs(textTable) do
            addEvent(doSendAnimatedText, i * 1000, pos, textTable[i], color)
        end
    end
 
Back
Top