Maris Posted February 23, 2020 Share Posted February 23, 2020 How to list all vehicles in the world? For example, I'd like to add rust while raining. ATPHHe 1 Link to comment Share on other sites More sharing options...
ATPHHe Posted March 6, 2020 Share Posted March 6, 2020 (edited) I am not sure how to list all vehicles in the world, but I do know how to list vehicles near your cell. Try one of these list of methods: getCell():getVehicles() getWorld():getCell():getVehicles() Both should return an ArrayList java object full of vehicles in the IsoCell that the player is in. -- Returns an ArrayList of vehicles near the player's cell that they are in. local function getVehicles() local cell = getCell(); local vehicles = cell:getVehicles(); return vehicles; end -- Returns an ArrayList of vehicles near the player's cell that they are in. local function getVehiclesIsoWorld() local world = getWorld(); local cell = world:getCell(); local vehicles = cell:getVehicles(); return vehicles; end I'm not sure how to put rust on vehicles. That's out of my coding scope for now. But maybe this might help. Good luck! local function addRustToVehicles() local world = getWorld(); local cell = world:getCell(); local vehicles = cell:getVehicles(); local size = vehicles:size(); for i=0, size - 1 do local vehicle = vehicles:get(i); -- Put rust on vehicle somehow? end end Here's the methods I was using. getWorld() IsoWorld:getCell() getCell() IsoCell:getVehicles() Edited March 21, 2020 by ATPHHe small modification to lua code for addRustToVehicles() function Maris 1 Link to comment Share on other sites More sharing options...
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