• 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 Which function use here?

president vankk

Web Developer & AuraOT Owner
Joined
Jul 10, 2009
Messages
5,719
Solutions
9
Reaction score
339
I got this script from 8.6 and I isn't working, and I don't have idea which function uses on it.
Code:
doSendAnimatedText(p, config[skill][1]..'['..newlevel..']', math.random(255))

Code:
doSendAnimatedText(cre_pos, "Block", math.random(1,255))

Code:
doSendAnimatedText(getCreaturePosition(config.data[2]), "points: "..poi, math.random(1,255))


Thanks.
 
The text is limited to only soo many characters.
Code:
    doSendAnimatedText(position, text, color)

I wrote a function for someone else you can use to animate an entire sentence except that it is broken up into 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

This would work the same way as the original with an exception mentioned above.

So using the p table as an example
Code:
        local p = {
            pos = {x = 50, y = 50, z = 7},
            text = "This is just an example",
            color = function() local color = {0, 5, 18, 35, 66, 78, 89, 112, 120, 129, 144, 152, 154, 156, 180, 190, 192, 205, 210, 215} return color[ math.floor( math.random(1, #color) ) ]  end
        }

Then calling the function passing the p's values to it
Code:
        doAnimatedAllText(p.pos, p.text, p.color())
 
Last edited:
Back
Top