Seats have a name ‘Seat1’ ‘Seat2’ and when a player sits in that seat, I specify what seat they are in into a table, so i can refer to it later. However when they choose to get up and leave, I have no way of knowing who actually left
-- Go through all the boards
for _, board in pairs(Connect4:GetChildren()) do
if board.PrimaryPart then
local Board = GenerateGame(board) -- Generate board
-- Go through all seats
for _, seat in pairs(board:GetDescendants()) do
if seat:IsA("Seat") then
seat.Changed:Connect(function()
if seat.Occupant then -- Player has sat down
local Character = seat.Occupant.Parent
local Player = Players:GetPlayerFromCharacter(Character)
if not Player then return end
Board[seat.Parent.Name] = Player -- Give player seat
else
-- Find player who left and remove them from Seat
end
end
end
end
end
end