Limit how often a building can be build

Place to get help with not working mods / modding interface.
Raelf
Burner Inserter
Burner Inserter
Posts: 12
Joined: Sun Dec 23, 2018 4:01 pm
Contact:

Limit how often a building can be build

Post by Raelf »

Hi all,

I‘m new here and thinking about an idea for a mod.
I want to create a super building with great benefits which for you need to spend enormous amounts of resourses.
But to make it not to much OP I would like to limitize how often it can be build.

Is this possible to do in a mod?
I could‘t find anything about that topic.

Best wishes,
Raelf
User avatar
MewMew
Long Handed Inserter
Long Handed Inserter
Posts: 55
Joined: Thu May 19, 2016 11:02 am
Contact:

Re: Limit how often a building can be build

Post by MewMew »

Yes,
you can do that with the on_built_entity event and a global variable that saves the amount of already built structures.
If there are too many, you can destroy it and reinsert it into the players inventory.
Maybe even print a message so they know that the limit is reached.
Post Reply

Return to “Modding help”