Atton Posted January 10, 2015 Share Posted January 10, 2015 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
Et-win Posted January 10, 2015 Share Posted January 10, 2015 Well, change/remove it then Link to comment
Gallardo9944 Posted January 10, 2015 Share Posted January 10, 2015 It works only if the elements were created on the same side (client/server) Link to comment
Atton Posted January 16, 2015 Author Share Posted January 16, 2015 It works only if the elements were created on the same side (client/server) I have tried it on both client and server and it does not work as said on the wiki. Please post some code to back yourself up. Link to comment
novo Posted January 16, 2015 Share Posted January 16, 2015 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. Link to comment
Atton Posted January 16, 2015 Author Share Posted January 16, 2015 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
novo Posted January 16, 2015 Share Posted January 16, 2015 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now