Jump to content

Wiki Isssue


Atton

Recommended Posts

Example 1: This example would destroy every element in the map, with the exception of players and the root element itself.

-- Find the root element (the element that contains all others)

root = getRootElement ()

-- Destroy all its children, except players.

destroyElement ( root )

https://wiki.multitheftauto.com/wiki/DestroyElement

I am not sure if this is the right place to post this but that does not work.

Link to comment
We would be able to provide you deeper assistance in case you tell us what element you're exactly trying to eliminate.

Though, in case you didn't know yet and it's what you were looking for, there's a function that permits you removing world objects @removeWorldModel.

How could you do the below as in remove all elements on the map.

Example 1: This example would destroy every element in the map, with the exception of players and the root element itself.

-- Find the root element (the element that contains all others)

root = getRootElement ()

-- Destroy all its children, except players.

destroyElement ( root )

Link to comment

Well, what that root example does is basically destroying any created element that has "root" as its parent.

And in case you want to remove the entire world: (wiki's example)

  
for i=550,20000 do 
    removeWorldModel(i,10000,0,0,0) 
end 
setOcclusionsEnabled(false)  -- Also disable occlusions when removing certain models 
setWaterLevel(-5000)         -- Also hide the default water as it will be full of holes 
  

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