deviant motive
New Member
- Joined
- Jul 9, 2009
- Messages
- 60
- Reaction score
- 0
Hi, i want monsters on my server to be provocated only when you are 5 sqm to them.
isInArea(pos, fromPos, toPos)
function getPlayersInRange(position, radiusx, radiusy)
local creaturesList = {}
for x = -radiusx, radiusx do
for y = -radiusy, radiusy do
if not (x == 0 and y == 0) then
local creature = getTopCreature({x = position.x+x, y = position.y+y, z = position.z})
if creature.type == 1 then
table.insert(creaturesList, creature.uid)
end
end
end
end
local creature = getTopCreature(position)
if creature.type == 1 then
if not(table.find(creaturesList, creature.uid)) then
table.insert(creaturesList, creature.uid)
end
end
return creaturesList
end
getPlayersInRange({x=123, y=123, z=1}, 5, 5)