what I’m trying to do here is that I want all the players to be telported into 10 seats even if there are only 3 players they will go in 3 random seats, but this script just does nothing onlt this error
attempt to index boolean with ‘Value’
local debounce = false
game:GetService("ReplicatedStorage"):WaitForChild("Values").StoryValues.TeleportPlayersOnBus:GetPropertyChangedSignal("Value"):Connect(function()
print("triggered")
for i,v in pairs(game.Players:GetPlayers()) do
print("players")
if v.Character then
print("Character")
local character = v.Character
if character.Humanoid.Sit.Value == false then -- heres the error
for i,seat in pairs(game.Workspace.HouseMap.SchoolBus.Seats:GetChildren()) do
if debounce == false then
if not seat.Occupant then
seat:Sit(character.Humanoid)
debounce = true
end
end
end
end
end
debounce = false
end
end)
local debounce = false
game:GetService("ReplicatedStorage"):WaitForChild("Values").StoryValues.TeleportPlayersOnBus:GetPropertyChangedSignal("Value"):Connect(function()
print("triggered")
for i,v in pairs(game.Players:GetPlayers()) do
print("players")
if v.Character then
print("Character")
local character = v.Character
if character.Humanoid.Sit == false then -- heres the error
for i,seat in pairs(game.Workspace.HouseMap.SchoolBus.Seats:GetChildren()) do
if debounce == false then
if not seat.Occupant then
seat:Sit(character.Humanoid)
debounce = true
end
end
end
end
end
debounce = false
end
end)