How do I un sit players while teleporting?

I have been working on these minigames and everything is going well, but there is one small problem, the lobby has chairs and since when you are sitting, you wont get teleported but will still count as in game. I tried to make the script unsit the players quickly before they teleport, but it doesn’t work. Got any ideas? This script is in Severscriptservice btw.

1 Like

Enable the Jump property and it should jump them out of their seat then it will disable itself again.

Humanoid.Jump = true

Try humanoid.Seated = false

here is the error btw
the problem is that is doesn’t recognize the playername as a workspace object

The problem is that it won’t recognize the players.

Change workspace.playername to workspace[playername.Name]

It didn’t work

Try this.

for _,Player in pairs(game.Players:GetPlayers()) do
	if Player.Character ~= nil then
		local spawnLocation = math.random(1, #workspace.Teleports.Teleports:GetChildren())
		Player.Character.Humanoid.Jump = true
		Player.Character.Parent = workspace.Ingame

The first line is looping through all the players currently in the server.
The second line checks if the Players character isn’t nil
The third line grabs a random number between 1 and the total amount of spawners in your game
The Fourth line makes the Character Jump so if they’re seated it will take them out of the seat.
The Fifth line Moves the player to the random spawn
The sixth line parents the Player to the workspace folder/model named Ingame

1 Like

Here, I updated your code

local players = game:GetService("Players")
local spawns = game:GetService("Workspace").Spawns
for _, player in ipairs(players:GetPlayers()) do
	if player.Character ~= nil then
		local spawnLocation = spawns[math.random(1, #spawns:GetChildren())]
		local character = player.Character
		character:FindFirstChildOfClass("Humanoid").Seated = false
		character.Parent = game:GetService("Workspace").InGame

Ahhhhhh, you beat me to it LOL

That wouldn’t work though, not only because the jump would cause them to not teleport in correctly, but because it completely kinda ruins the Ingame thing

Why wouldn’t it work? It makes the player jump like they would to manually “unsit”.

It wouldn’t work as in then it makes the Ingame folder not work and neither would the rest of the script. the script relies on how I have the ingame folder already set up.

Have you tried my code I gave?

That would also make the script not work as well.

uh, no it works just fine for me…

Did you even try my code or did you just look at it and say no. I’m going off the limited script snippets you have provided in the OP. I am not a mind reader, I cannot see the hidden parts of your script. Furthermore you should be providing every aspect of the script so we know if something will break it.

That is because you don’t have a bunch of other parts of the script that relies on how I already have the ingame set up

but I dont need the “other parts” you listed the code you needed help with which me and @IEnforce_Lawz has helped with.

I just need something to put in between here to unsit each player.