Jump to content

check if model exist


orel56000

Recommended Posts

3 minutes ago, NeXuS™ said:

You can try to create the object and if it runs succesful, you know it is a valid id.

That how I've done that, but it is printing me warnings and I thought to myself if there is an other way, why not to ask?

Edited by orel56000
Link to comment
34 minutes ago, ÆBKV said:

function getObjectID()
  local objects = getElementsByType("object")
  for i,object in ipairs(objects) do
    if getElementModel(object) then
      return object      
    end
  end
  return false
end

try this

Useless code. Would stop after the first object found.

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...