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

check if monster at position

Magictibiaman

New Member
Joined
May 25, 2009
Messages
371
Reaction score
0
if i want to check whether a monster (not a player) is at a position how do i do that?

pos = {x=100, y=100, z=7, stackpos=253}

cause i want to make sure all monsters in a room are dead before the bars from the door are gone
 
yes and you need the Position on the floor the monster is ? You can chekk this with Rme , Or you God/GM/Tutor, What Sqm Postion the monster is


Give rep++, I give Back!
 
no no no no. your not understanding, you don't understand anything about scripting. i am talking about how to check a monster's position if is at

pos = {x=100, y=100, z=7, stackpos=253}
which is an example

it could be 1 space or a hundred spaces at the same time,

i want to check if it is there, it is not there then the prison bars on the door dissapear
 
sorry i just got fustrated, i didn't mean to take it out on you.

was just affended that you regarded me as such a noob not to know how to find xyz on the map editor
 
Get it from this (I don't know what you want it for):
Code:
local starting= {x = 497, y = 755, z = 10}
local ending= {x = 500, y = 755, z = 10}
function cleanArea()
    local checking= {x = starting.x, y = starting.y, z = starting.z, stackpos = 253}
    local monster = {}
    while(checking.y <= ending.y) do
        local creature = getTopCreature(checking)
        if(isCreature(creature) == TRUE) then
            if(isPlayer(creature) == TRUE) then
                return false
            else
                table.insert(monster, creature)
            end
        end
        if(checking.x == ending.x) then
            checking.x = starting.x
            checking.y = checking.y + 1
        end
        checking.x = checking.x + 1
    end
    for i, c in ipairs(monster) do 
        doRemoveCreature(c)
    end    
    return true
end
 
Back
Top