So I'm going to explain with comments in my script..
I wrote a Server Script
but a part of it doesn't seem to be working
local roundRunning = false local Intermission = true local seatOne = game.Workspace.Chair1.Seat local seatTwo = game.Workspace.Chair2.Seat local seatThree = game.Workspace.Chair3.Seat local seatFour = game.Workspace.Chair4.Seat local seatFive = game.Workspace.Chair5.Seat local chairSix = game.Workspace.Chair6.Seat if Intermission == true then local intermissionHint = Instance.new("Hint", workspace) for i = 30, 0, -1 do intermissionHint.Text = "Intermission: "..i wait(1) if i == 0 then wait(1) intermissionHint:Destroy() Intermission = false roundRunning = true end end end if roundRunning == true then for i,v in pairs(game.Players:GetPlayers()) do v.Character.HumanoidRootPart.CFrame = CFrame.new(25.61, 7.989, 11.08) end local playersInCurrentGame = {} -- This is a table of players in the current round, I'll work on this later local playersSeated = {} -- Players seated table THIS IS MY PROBLEM if seatOne:FindFirstChild("SeatWeld") then -- Here I'm checking for the seat weld that's created when players sit. RootPartOfPlayer = seatOne.SeatWeld.Part1 -- I'm defining the root part playerInThisSeat = game.Players:GetPlayerFromCharacter(seatOne.SeatWeld.Part1) -- Here defining the player in the seat table.insert(playersSeated, playerInThisSeat) -- Here inserting the player into this table for i,v in pairs(playersSeated) do print(playersSeated[i].Name) -- Here I'm trying to print who's in the seat (for testing purposes) but it's not printing anything if anyone could help me fix my mistake it would be appreciated end end end
It is not working because on line 34, you use GetPlayerFromCharacter
which takes the actual player model as the argument, not a part, so it will always return nil.