How could I assign a random bed to multiple NPCs at the same time without them ending up using the same bed? Help is appreciated since I cannot finish the night cycle without this, therefore can't continue the game development.
Simple explanation: A player creates a town, new villagers (NPCs) want to live in the town. The player places multiple beds, and once It's nighttime villagers need to go to a random bed without ending up on the same bed. Similar way to Minecraft villagers
I've tried using math.random() on a table but they ended up on the same bed.
Thanks!!!!

3 comments
Incase you are confused about the logic here: Let's say I have a shopping stroller. I pick an random item in the grocery store, then take another random item in the grocery store, but before putting the item in your stroller, you check if your stroller already have that item. If there is, pick another random item. If there isn't, put the randomized item in, and repeats. Now you have a shopping str
Hey! Tysm for replying! The script was really helpful Sorry for bothering again, but how could I assign each number to a bed (I'm not good with stuff like this)
make that to a new question and add some more scripts for example @Vhexp