• 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 distance effect at position

Solution
event.lua
Lua:
function onThink(interval, lastExecution)
    local position = {x=1000,y=998,z=7}
    local fromPos = {
        {x=999,y=998,z=7},
        {x=1001,y=998,z=7},
        {x=999,y=999,z=7},
        {x=1000,y=999,z=7},
        {x=1001,y=999,z=7},
        {x=999,y=997,z=7},
        {x=1000,y=997,z=7},
        {x=1001,y=997,z=7}
    }
  
    for _,v in ipairs(fromPos) do
        doSendDistanceShoot(v, position, 20)
    end
    return true

end
if you want to outside change position with v and v with position



globalevents.xml
XML:
<globalevent name="event"  interval="10000"  event="script" value="event.lua"/>
You mean on death or what? Be more specific
I mean like that in the gif picture to do this effect every ten seconds in all sides of tile
yXrCwDkhUNdgvjth87SlXUV8IqXQZToA4FL6ihSAi_bUOJGiDwPlpvyUXPLyN06yo8Hc2HUKQLfksJkN_vUI1cq0c_QYhEcnAqPW1OR-Cf6sMVSVHscriGaisTa_ObNEvEqNNooWFzc-jP3aREou5plkIiiU9HpWdcW7HQcbzTiDG5suDSWNfSYGJ_hDgBE-SSYrHz6wiyCn0owe476sPQyx2hqDCIIE1S8p9SPZt4OSdXugzrhbfD6JzP38gc4wRdiA4A8PJHBIBYXqLA3pVrqWoNyaUwjvlxI2TBSszv0qJbQWxHuHaTDGSBHXTm5JDhALm3y20HqDXMxkbf4cMH4aGMVvHBbDh7w_Acu-ytZN6hsTgKoFaAZk6RvyA0onaOtDozAzEIPfdUQJWvSoRsY18gVFfrPrJ_7GNHpiMPboqRuGVlIIQX61lb8wD8OxR9eki4_lBle0g588Fa0vbJHcEDYBn4vZwDNoptkMz7lZmsgf1TCuGzPXNYy9g9D3DXJ1TwjIQ96ppWd6OV8NRjyAjhZsgZpZscRxv9RbxXyBiO0MHfm2jpP38SR3ebeEeRSGkMfSl1T_UOgh0uyE9HqFjh1cPxWqm4C3yPirst0nIPh5XPTuXZXacIX4INhEvbxYY4aKPBTi8UzZFeeNdof_uG0H6QPFIdNF5-z4jcU=w246-h268-no
 
Last edited:
every ten seconds for all players? and effect to inside or to outside
It has nothing to do with players I just post the gif to see the effect Then apply it to the script like this:-
C++:
function onThink()
local asd = math.random(0, 30)
    for i = 1,2 do
    addEvent(doSendDistanceShoot,i*100,{x=1000,y=998,z=7}, {x=998,y=996,z=7}, asd)
    end
    return true
end
but I want to change this effect It's irregular, I want to organize an effect to make it absorbed inside as in the gif picture that I posted
 
event.lua
Lua:
function onThink(interval, lastExecution)
    local position = {x=1000,y=998,z=7}
    local fromPos = {
        {x=999,y=998,z=7},
        {x=1001,y=998,z=7},
        {x=999,y=999,z=7},
        {x=1000,y=999,z=7},
        {x=1001,y=999,z=7},
        {x=999,y=997,z=7},
        {x=1000,y=997,z=7},
        {x=1001,y=997,z=7}
    }
  
    for _,v in ipairs(fromPos) do
        doSendDistanceShoot(v, position, 20)
    end
    return true

end
if you want to outside change position with v and v with position



globalevents.xml
XML:
<globalevent name="event"  interval="10000"  event="script" value="event.lua"/>
 
Last edited:
Solution
event.lua
Lua:
function onThink(interval, lastExecution)
    local position = {x=1000,y=998,z=7}
    local fromPos = {
        {x=999,y=998,z=7},
        {x=1001,y=998,z=7},
        {x=999,y=999,z=7},
        {x=1000,y=999,z=7},
        {x=1001,y=999,z=7},
        {x=999,y=997,z=7},
        {x=1000,y=997,z=7},
        {x=1001,y=997,z=7}
    }
  
    for _,v in ipairs(fromPos) do
        doSendDistanceShoot(v, position, 20)
    end
    return true

end

globalevents.xml
XML:
<globalevent name="event"  interval="10000"  event="script" value="event.lua"/>
super cool that it's !
thanks mate appreciated <3
 
event.lua
Lua:
function onThink(interval, lastExecution)
    local position = {x=1000,y=998,z=7}
    local fromPos = {
        {x=999,y=998,z=7},
        {x=1001,y=998,z=7},
        {x=999,y=999,z=7},
        {x=1000,y=999,z=7},
        {x=1001,y=999,z=7},
        {x=999,y=997,z=7},
        {x=1000,y=997,z=7},
        {x=1001,y=997,z=7}
    }
 
    for _,v in ipairs(fromPos) do
        doSendDistanceShoot(v, position, 20)
    end
    return true

end
if you want to outside change position with v and v with position



globalevents.xml
XML:
<globalevent name="event"  interval="10000"  event="script" value="event.lua"/>
I'd probably do it like this instead

Same result, just a different way of going about it.
Lua:
local effects = {{-1, 0}, {1, 0}, {-1, 1}, {0, 1}, {1, 1}, {-1, 1}, {0, -1}, {1, -1}}
local pos = {x = 1000, y = 998, z = 7}

function onThink(interval, lastExecution)   
    for i = 1, #effects do
        doSendDistanceShoot({x = pos.x + effects[i][1], y = pos.y + effects[i][2], z = pos.z}, pos, 20)
    end
    return true
end
 
I'd probably do it like this instead

Same result, just a different way of going about it.
Lua:
local effects = {{-1, 0}, {1, 0}, {-1, 1}, {0, 1}, {1, 1}, {-1, 1}, {0, -1}, {1, -1}}
local pos = {x = 1000, y = 998, z = 7}

function onThink(interval, lastExecution)  
    for i = 1, #effects do
        doSendDistanceShoot({x = pos.x + effects[i][1], y = pos.y + effects[i][2], z = pos.z}, pos, 20)
    end
    return true
end
appreciated mate
 
Back
Top