local Players = game:GetService("Players")
local Chair = game.Workspace.Chair -- whatever your value is
Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
char:MoveTo(Chair.Position)
Chair:Sit(char.Humanoid)
I’m not sure why, but it still has the same error message, did you see i said the seat had a proximity prompt and is this script is supposed to go into serverscriptservice?
The script that I made is for player joining and forced to sit at different seats, but you could also use this to force someone into one seat instead of multiple seats.
local chairFolder = game.Workspace.Chair
local Players = game.Players
--Table to hold the chair variables, and if they're taken or not.
local seatStatus = {
{chair = chairFolder.Seat, taken = false},
{chair = chairFolder.Seat, taken = false},
{chair = chairFolder.Seat, taken = false},
{chair = chairFolder.Seat, taken = false},
{chair = chairFolder.Seat, taken = false}
}
function seatPlayers(player)
local character = player.Character or player.CharacterAdded:Wait()
local hum = character:FindFirstChildOfClass("Humanoid")
hum:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
if hum then
--Looks through all seats in the table and checks if they're taken.
for i, v in pairs(seatStatus) do
if v.taken == false then
wait(0.5)
v.chair:Sit(hum)
v.taken = true
break
else --If it is taken, will continue untl the end of the table, or until it finds a chair not taken,
end
end
end
end
Players.PlayerAdded:Connect(seatPlayers) --Fires the seatPlayers function when a player joins the game