Randomly assign a "bed" to multiple NPCs

Hello! :slight_smile:
I’ve been working on a small project that lets players Build their village.
The thing is that the player is the one that places the beds, which means I can’t assign each villager a bed.

I’ve tried randomizing the table, but NPCs ended up on the same bed, etc…

How could I assign a bed to each (current and NPCs added while playing) without making them choose the same bed?


If the bed is occupied then skip it.

But how can I know if the bed is occupied?
I guess with a value, but how do I assign it in the first place?

When NPC chosen the bed, set the bool value to true

Use attributes instead -------