-- In a server script inside ServerScriptService.
local players = game:GetService("Players") -- Players service
local seat = workspace:WaitForChild("MainSeat")
players.PlayerAdded:Connect(function(plr)
local char = plr.Character or plr.CharacterAdded:Wait()
local hum = char:FindFirstChildOfClass("Humanoid") -- The Humanoid
seat:Sit(hum);
end)
That is the code I used that someone helped me write. it's supposed to make a player sit down when they join but I get this error please help me fix this and anymore errors you can spot thanks :)

3 comments
Thanks :)
No problem.
If the Humanoid is in NoneState, sitting won't work. Here waiting fixes it, because in that time the state changes. A more robust option instead of waiting would be to use the humanoid.StateChanged event to wait for the NoneState to end.