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)