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

what is faster in execution time [getSpectators function or 3 for loops to check around tiles]

S

Shadow_

Guest
hello,

i was wondering which can be faster execution wise using getspectators function or this code
Lua:
                        for x = positionPlayer.x - distance, positionPlayer.x + distance do
                            for y = positionPlayer.y - distance, positionPlayer.y + distance do
                                for z = positionPlayer.z, positionPlayer.z do
                                    local tileP = Tile(x, y, z)
                                    if tileP then
                                        local creatureP = tileP:getTopCreature()
                                        if creatureP and creatureP:isPlayer() then
                                            for xx = 1, #names do
                                                if creatureP:getName() == names[xx] then
                                                    posOfPlayer[#posOfPlayer+1] = creatureP
                                                end
                                            end
                                        end
                                    end
                                end
                            end
                        end
 
Back
Top