PerfX Posted September 21, 2021 Share Posted September 21, 2021 I have 2000 objects, I need to move them 800 meters from the map, how can I do this? Link to comment
The_GTA Posted September 21, 2021 Share Posted September 21, 2021 local objects = getElementsByType("object") local offx = 0 local offy = 0 local offz = 800 for m,n in ipairs(objects) do local x,y,z = getElementPosition(n) setElementPosition(n, x+offx, y+offy, z+offz) end Link to comment
PerfX Posted September 21, 2021 Author Share Posted September 21, 2021 8 minutes ago, The_GTA said: local objects = getElementsByType("object") local offx = 0 local offy = 0 local offz = 800 for m,n in ipairs(objects) do local x,y,z = getElementPosition(n) setElementPosition(n, x+offx, y+offy, z+offz) end thx But there is a problem, I have 3 folders and 3 different lua files, I put this code in each file, and it only downloads one part Link to comment
The_GTA Posted September 21, 2021 Share Posted September 21, 2021 (edited) 3 minutes ago, PerfX said: thx But there is a problem, I have 3 folders and 3 different lua files, I put this code in each file, and it only downloads one part You have to put this code into the last Lua file or create a new one. To make sure everything has loaded you can put it inside of a resource-start event handler. It depends on whether your code is running clientside or serverside. Edited September 21, 2021 by The_GTA Link to comment
PerfX Posted September 21, 2021 Author Share Posted September 21, 2021 8 minutes ago, The_GTA said: You have to put this code into the last Lua file or create a new one. I don't understand scripting, let me give you a link to the map, will you try to do it? Link to comment
The_GTA Posted September 21, 2021 Share Posted September 21, 2021 27 minutes ago, PerfX said: I don't understand scripting, let me give you a link to the map, will you try to do it? Yes. 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