How do I make it so that my character spawns sitting in a chair

Im working on a game where the player spawns in first person and is sitting in a chair unable to move but im fairly new to coding thus i dont really know how to make that work

how would i go about writing this kind of script that would spawn the player sitting on the seat and doesnt effect the character being in first person

ive even tried putting the spawn right under the chair so it sits as its loading in but that also causes some problems like the character standing on the chair when it loads in or being stuck inside the chair

ive tried looking at posts by other ppl asking a similar question but for some reason the scripts either didnt work or were outdated

just a heads up the character will be locked in first person when they spawn if that helps

Do you mean when the character spawns for the first time, or just whenever they spawn?

1 Like

I mean when they spawn for the first time

You can put this code into a server script inside the seat:

local players = game:GetService('Players')
players.PlayerAdded:Connect(function(player)
	local added
	added = player.CharacterAdded:Connect(function(character)
		added:Disconnect()
		task.wait(0.1)
		local humanoid = character:WaitForChild('Humanoid')
		humanoid.JumpPower = 0
		while not humanoid.Sit do
			character:WaitForChild('HumanoidRootPart').CFrame = script.Parent.CFrame
			task.wait()
		end
	end)
end)

To let the player jump again, set their JumpPower to 50 (default) or anything else you want as long as it’s above 0.

Or just use this:
Spawn In Seat.rbxm (2.9 KB)


For anyone reading this in the future, you may also want to check out the Sit function.

6 Likes

thanks a bunch its working now :smiley:
appreciate the help

1 Like