Detection of Last Player Used Entity

Place to get help with not working mods / modding interface.
gilbertrpg
Manual Inserter
Manual Inserter
Posts: 1
Joined: Wed Mar 17, 2021 1:27 am
Contact:

Detection of Last Player Used Entity

Post by gilbertrpg »

Hi all!

I'm working on a mod but need some help with finding a last-used entity (such as a vehicle) and am having difficulty understanding how to filter out all entities and only search for a specific type of entity through lua. Any help is appreciated!
User avatar
Silari
Filter Inserter
Filter Inserter
Posts: 586
Joined: Sat Jan 27, 2018 10:04 pm
Contact:

Re: Detection of Last Player Used Entity

Post by Silari »

Sounds like you want https://lua-api.factorio.com/latest/Lua ... s_filtered . There's a type= parameter to filter by entity type, or possibly you actually want to use the name= parameter. Type is more general - both the car and tank are type="car", but only the car is name="car".
Post Reply

Return to “Modding help”