• 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 Effects very fast!!

Szka

Member
Joined
Jul 27, 2016
Messages
65
Reaction score
11
Location
Chile
Hi guys!
Im putting some effects with text on some statues and it is changing really fast! I love the effects but I would like that the effects changes slowly, like every 1 or 2 seconds...

Dont know how to change this, and I modified the globalevents.xml to change the interval but it stay the same...

Here is the code
Code:
function onThink(interval, lastExecution)
same = math.random(01, 255)
doSendAnimatedText({x = 32257, y = 32221, z = 7}, 'Axe', math.random(01,255))
doSendMagicEffect({x = 32257, y = 32221, z = 7}, math.random(38, 50))
doSendAnimatedText({x = 32257, y = 32225, z = 7}, 'Club', math.random(01,255))
doSendMagicEffect({x = 32257, y = 32225, z = 7}, math.random(38, 50))
doSendAnimatedText({x = 32253, y = 32219, z = 7}, 'Sword', math.random(01,255))
doSendMagicEffect({x = 32253, y = 32219, z = 7}, math.random(38, 50))
doSendAnimatedText({x = 32248, y = 32221, z = 7}, 'Distance', math.random(01,255))
doSendMagicEffect({x = 32248, y = 32221, z = 7}, math.random(38, 50))
doSendAnimatedText({x = 32248, y = 32225, z = 7}, 'Magic', math.random(01,255))
doSendMagicEffect({x = 32248, y = 32225, z = 7}, math.random(38, 50))
return TRUE
end

Thanks guys!
 
Thanks for your fast reply :)
Here is the xml! Hope this is the one you wanted xD]
Code:
<?xml version="1.0" encoding="UTF-8"?>
<globalevents>
    <globalevent name="effecttile" interval="5" script="effectile.lua"/>
    <globalevent name="save" interval="1800000" event="script" value="save.lua"/>
    <globalevent name="clean" interval="7200000" event="script" value="clean.lua"/>
    <globalevent name="serverstart" type="start" event="script" value="start.lua"/>
    <globalevent name="playersrecord" type="record" event="script" value="record.lua"/>
    <globalevent name="raid" interval="108000" event="script" value="raid.lua"/>
    <globalevent name="offtrain_add_minutes" interval="60000" event="script" value="offtrain_addMinutes.lua"/>  
</globalevents>
 
Thanks for your fast reply :)
Here is the xml! Hope this is the one you wanted xD]
Code:
<?xml version="1.0" encoding="UTF-8"?>
<globalevents>
    <globalevent name="effecttile" interval="5" script="effectile.lua"/>
    <globalevent name="save" interval="1800000" event="script" value="save.lua"/>
    <globalevent name="clean" interval="7200000" event="script" value="clean.lua"/>
    <globalevent name="serverstart" type="start" event="script" value="start.lua"/>
    <globalevent name="playersrecord" type="record" event="script" value="record.lua"/>
    <globalevent name="raid" interval="108000" event="script" value="raid.lua"/>
    <globalevent name="offtrain_add_minutes" interval="60000" event="script" value="offtrain_addMinutes.lua"/> 
</globalevents>
assuming it's effecttile and you're using 0.4, 0.4 runs events in milliseconds, so your interval is 5 milliseconds and not 5 seconds.
also, here's better code
Code:
local function Position(x, y, z)
    return {x = x, y = y, z = z}
end

local t = {
    {Position(32257, 32221, 7), 'Axe'},
    {Position(32257, 32225, 7), 'Club'},
    {Position(32253, 32219, 7), 'Sword'},
    {Position(32248, 32221, 7), 'Distance'},
    {Position(32248, 32225, 7), 'Magic'}
}

function onThink(interval, lastExecution)
    for i = 1, #t do
        local e_rand, t_rand = math.random(38, 50), math.random(255)
        local pos, txt = t[i][1], t[i][2]
        doSendAnimatedText(pos, txt, t_rand)
        doSendMagicEffect(pos, e_rand)
    end
    return true
end
 
Thank you bro! Your script worked just fine (Really appreciate that you even copy my X, Y, Z positions)
And you were right, I'm using TFS 4.0 so it was on miliseconds!
 
Back
Top