Jump to content

Objects distance


xeon17

Recommended Posts

would work , it can also work with tables.

if you want the objects visible from far distance then this would work.

local objects = getElementsByType("object") 
    for i, v in ipairs(objects) do 
    local ID = getElementModel (v) 
    if ID == 3113 then 
    local x,y,z = getElementPosition(v) 
    local xr,yr,zr = getElementRotation(v) 
    setLowLODElement(v,createObject ( getElementModel(v), x,y,z,xr,yr,zr,true )) 
    end 
    end 

local id = {3113,980, --[[add more ids here]]} 
  
for i, v in pairs (id) do 
-- your code here 
-- if ID == v then etc.. 
end 

Link to comment

There is actually a limit you can't set distance bigger than 300.

"However, there is a general draw distance limit of 300 units. So engineSetModelLODDistance(1337,400) will mean model 1337 will be visible up to a distance of 300 units no matter what the 'Video' tab says." from wiki.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...