Recreate Seat:Sit() on the client

That’s a bool value. It only says if the humanoid is sitting or not.

1 Like

Just call the sit function from server due to a remote event.

--Server
RemoteEvent.OnServerEvent:Connect(function(plr)
      SeatObject:Sit(plr.Character.Humanoid)
end)

--Client
RemoteEvent:Fire()

API: Seat | Documentation - Roblox Creator Hub

1 Like

Do you mean that you want the humanoid to sit in a seat, as implied by your code?

I made the humanoid CLIENT-SIDED. It does not ever exist on the server.

@goldenstein64 Yes.

1 Like

Move the humanoid creation to the server. You can do this through a remote if you need to wait, or put the code in starter character scripts.

No. I have my game architecture set up this way for a reason. That is not a solution to this problem either. I’m looking for a way to recreate the sit() function on the client.

You could just weld the humanoid root part to the seat, then set humanoid.Sit to true to play the animation. To undo, delete the weld and set humanoid.Sit to false.

10 Likes

If you decided to weld the player to the actual seat, you would have to handle user input to detect when the player wants to leave the vehicle…

userinputservice → space bar → break weld → teleport player 2 studs above car (or have the player jump)

Exactly what you would have to do. He wants to keep the humanoid local (not sure why) to the player, so this is the best option. You might be able to do humanoid.Jumped, through I’m not sure if that will fire. I think it will though.

1 Like

Thank you. I had no idea setting the sit property to true would also play the animation. Saves some time.

I think that welding it would be a better alternative, considering that you could have more control over entering the vehicle… example(in jailbreak, you can press E to enter a vehicle if you are close enough - rather than having to touch the seat)

This works for R15, R6, and Rthro. If you wanted, you could create a custom animation instead and play it.

Humanoid.Sit plays the animation and prevents player control. It does not weld the player.

But for roblox “seat” objects, it does weld you to the seat whenever you touch it.

He wants to do this remotely without touching the seat. Read the OP. The seat:Sit function only works on the server.

This is all irrelevant. This wasn’t even for a player, it was for an NPC. My question has been answered.

I also never mentioned players.

This is getting off-topic. I have my answer, and anyone who stumbles upon this thread will have everything they need :slight_smile:

NPCs also have Characters with Humanoids, It’s just most people don’t use them for it’s intended purpose and end up making NPCs without Humanoids.

The more you know. It’d be nice for them to change this behavior to work locally as well. It baffles me how many features Roblox actually half implemented… But maybe NPCs weren’t really a thing in the beginning and turned out to be a bug turned future.

@Intended_Pun in case it helps you in the future. I generate my NPCs on the server and cache them in ReplicatedStorage. The client then checks ReplicatedStorage for the cached versions and make copies as needed to create them locally. This circumvents changes to Insert Service not working on the client, in the event that your NPCs needs to use the HumanoidDescription System.

Please don’t hurt me, I tried keeping this on topic as much as possible solely to respond to Nuclear :sob:

I don’t see the phrase “NPC” once within the OP. Am I missing something?

My NPC part was in response to Intended_Puns statement as follows.

Since I figured he’s doing his Humanoids on the client, same as me. That he may one day try to use the HumanoidDescription System to apply an appearance easily on the Humanoid. Which as the time of this post doesn’t work on NPCs (unless somethings recently changed.)

I simply wanted to share with him that he could still spawn NPCs locally while spawning them on the server.

To answer your question tho, it was a reply I was talking about, not the OP, Since that was already solved… I didn’t see the need to try to solve it again. And since there’s a designated post marked as a solution. It didn’t feel that far off topic and could still be helpful to others.