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

RevScripts create 3 items close to the player up to 3 sqm away

alcapone

Member
Joined
Jan 13, 2021
Messages
246
Reaction score
19
create 3 items next to the player
if the player does not pass over the item a monster will spawn
after 5 minutes remove the monster that was created

Lua:
local area = {
    fromPos = {x = 32363, y = 32138, z = 7},
    toPos = {x = 32371, y = 32145, z = 7}
}

local function getPlayerFromArea()
    for x = area.fromPos.x, area.toPos.x do
        for y = area.fromPos.y, area.toPos.y do
            for z = area.fromPos.z, area.toPos.z do
                local t = Tile(x,y,z)
                if t and t:getTopCreature() and t:getTopCreature():isPlayer() then
                    return t:getTopCreature()
                 end
                 end
        end
    end
    return nil
end



local test = GlobalEvent("test")
function test.onThink(interval)
    local p = getPlayerFromArea()


     p:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
    
 
        

    return true
end
test:interval(1000)
test:register()
 
What is the event that will trigger the system? Every so often? To all players at the same time? Is it Random or is it always activated for all players?
 
Back
Top