So, I am trying to make a musical chairs game but am having struggles on trying to figure out a way to make the game fair when it comes to trying to place the seat models in the right place depending on the amount of players in a script. Anybody have any ideas on how I could accomplish something like this or what is the best way?
Your best bet would be to clone a predetermined set of chairs. Customizing the vector qualities would be useless code which could easily be avoided.
Let’s say you have 7 players currently playing (which you could store in a table). What you could do is go into ServerStorage and clone the amount of chairs relative to the amount of players. You could clone a model named “7”.
I suggest this method only because you’re not cloning very much. You’re cloning about 10 chairs with about 10 parts each so it shouldn’t cause too much server strain.
Here’s some example code:
local ServerStorage = game.ServerStorage
local players = game.Players
local inGame = { } -- this would contain the players
--when something happens, do
local amount = #inGame
local name = tostring(amount)
local clone = ServerStorage:FindFirstChild(name)
clone:Clone().Parent = workspace