Sit : Seat or Humanoid is not in Workspace

I am trying to fix this Seat error like past few hours ago but, still I did not figure it out. When I remove the PlayerSittingScript and after the seats when the job is done. Still, I am getting the error for some reason?

PlayerSittingScript:

local Players = game:GetService("Players")
local Waitw = require(game.ReplicatedStorage.Modules.CustomWait)

game.Workspace.BLACKHAWK.Pilot:Sit(game.Workspace.pilot_1.Humanoid)
game.Workspace.BLACKHAWK.Pilot2:Sit(game.Workspace.pilot_2.Humanoid)


Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		coroutine.resume(coroutine.create(function()
			local SpawnNumber = character:WaitForChild("SpawnNumber")
			SpawnNumber.Value = game.Players.NumPlayers
			Waitw(5)
			
			local Humanoid = character:WaitForChild("Humanoid")

			local Seat1 = game.Workspace.BLACKHAWK.Seats:WaitForChild("Seat1")
			local Seat2 = game.Workspace.BLACKHAWK.Seats:WaitForChild("Seat2")
			local Seat3 = game.Workspace.BLACKHAWK.Seats:WaitForChild("Seat3")
			local Seat4 = game.Workspace.BLACKHAWK.Seats:WaitForChild("Seat4")
			local Seat5 = game.Workspace.BLACKHAWK.Seats:WaitForChild("Seat5")
			local Seat6 = game.Workspace.BLACKHAWK.Seats:WaitForChild("Seat6")

			if SpawnNumber.Value == 1 then
				while Waitw(.1) do
					Seat1:Sit(Humanoid)
				end
			elseif SpawnNumber.Value == 2 then
				while Waitw(.1) do
					Seat2:Sit(Humanoid)
				end
			elseif SpawnNumber.Value == 3 then
				while Waitw(.1) do
					Seat3:Sit(Humanoid)
				end
			elseif SpawnNumber.Value == 4 then
				while Waitw(.1) do
					Seat4:Sit(Humanoid)
				end
			elseif SpawnNumber.Value == 5 then
				while Waitw(.1) do
					Seat5:Sit(Humanoid)
				end
			elseif SpawnNumber.Value == 6 then
				while Waitw(.1) do
					Seat6:Sit(Humanoid)
				end
			end
		end))
	end)
end)

game["Run Service"].Stepped:Connect(function()
	game.ServerStorage.SafeValues:WaitForChild("PlrsHeli").Value = game.Players.NumPlayers
end)

1 Like

That is an module it uses os.clock

The error is on the title. You can see it.

When I remove the script and seats the error starts like it loops that erro again and again.

image

You really should use a switchcase for all of those seat checks.

Seeing this makes me see one specific developer all over again.

How to make players not jump from they’re seats bruh.

player.CharacterAdded is creating a new thread every time a character spawns, you can’t sit a Humanoid on a non-existent reference.

The seats from game.Workspace.BLACKHAWK.Seats has been destroyed, looking at the image you provided. When that happens, the reference is gone, so you can’t use BLACKHAWK.Seats because it is not there anymore, try using WaitForChild(“Seats”) instead.

Thanks for the explaination now I understood what was the problem going on!