• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction Christmas Command!

gelendizer

The ass kicker
Joined
Nov 2, 2011
Messages
335
Reaction score
10
Location
infront of my pc?
Hello OTlanders, since its Christmas I decided to release a new command which basically says "Merry Christmas OTland" (you can edit the text easily from the script)

So here it is,
Code:
local config =
{
    text = "Merry, Christmas, OTLAND!",
    color = {1, 255},
    start = "start", --start = from first to end text, end = last --> first text.
    interval = 200 --Interval between each letter/word
}
    h = 0
    f, t = 1, 1
    len = (type(config.text) == "string" and string.len(config.text) or 1)
    s = {}
function onSay(cid, words, param, channel)
    pos = getCreaturePosition(cid)
    if config.start == "start" then
        if type(config.text) == "string" then
            for i = 1, len do
                table.insert(s, string.sub(config.text, f, t))
                f = f + 1
                t = t + 1
                if i == len then
                    f = 1
                    t = 1
                end
            end
        elseif type(config.text) == "table" then
            for i = 1, table.maxn(config.text) do
                table.insert(s, config.text[i])
            end
        end
    elseif config.start == "end" then
        if type(config.text) == "string" then
            f, t = len, len
            for i = 1, len do
                table.insert(s, string.sub(config.text, f, t))
                f = f - 1
                t = t - 1
                if i == len then
                    f = 1
                    t = 1
                end
            end
        elseif type(config.text) == "table" then
            p = table.maxn(config.text)
            for i = 1, table.maxn(config.text) do
                table.insert(s, config.text[p])
                p = p - 1
            end
        end
    end
    for i = 1, table.maxn(s) do
        c = (type(config.color) == "table" and math.random(config.color[1], config.color[2]) or type(config.color) == "number" and config.color or 255)
        addEvent(doSendAnimatedText, h, pos, s[i], c)
        h = h + config.interval
        if i == table.maxn(s) then
            f, t, h, s = 1, 1, 0, {}
        end
    end
    return true
end
 
Back
Top