Hi. I have something like this:
addCommandHandler( 'wrem', function( player, command, radius )
if radius then radius = tonumber( radius ) else radius = 10 end
local t = false;
local x,y,z = getElementPosition( player )
for i=500,20000 do
t = removeWorldModel( i,radius, x, y, z )
if t == true then
outputChatBox( "[WREM] First object found: model "..i..", radius "..radius, player )
break
end
end
outputChatBox( "[WREM] Done.", player )
end )
This function should return first met object but it returns true for every iteration. I want to ask someone who really knows what's up - who knows how to find and call, for example, function used in editor which returns world object on click. I didn't study that code yet, so if someone can give some hint will be appreciated.