getActorsByBox


--Parameters:
local objtype=1--Type parameter: 0 all 1 player 2 creature 3 drop 4 throwable
local x1,y1,z1=0,7,0--area starting coordinates
local x2,y2,z2=50,57,50--The coordinates of the end point of the area
--Get the number and list of items of type type within the range of (x0,z0) height y0 to (x1,z1) height y1
local result,num,objids=World:getActorsByBox(objtype,x1,y1,z1,x2,y2,z2)
--Display the number in the chat box
Chat:sendSystemMsg("There are a total of "..num.." players in the range")
--Display the list in the chat box
for i,a in ipairs(objids) do
Chat:sendSystemMsg("The "..i.." one: "..a)
end