This script is either not picking up the change of the players team or the change of the BoolValue when the function is ran a second time. Why?
seat = script.Parent
team = game:GetService("Teams").King
rStorage = game:GetService("ReplicatedStorage")
seat.Changed:Connect(function()
wait()
if seat.Occupant then
local character = seat.Occupant.Parent
local player = game.Players:GetPlayerFromCharacter(character)
if player.Team ~= (team) and rStorage.BoolValue.Value == false then
rStorage.BoolValue.Value = true
player.Team = (team)
player:LoadCharacter()
rStorage.RemoteEvent1:FireAllClients()
seat.Disabled = true
wait(1)
seat.Disabled = false
elseif player.Team == (team.Parent.Blue) and rStorage.BoolValue.Value == true then
rStorage.RemoteEvent2:FireAllClients()
rStorage.RemoteEvent2:FireClient(player)
elseif player.Team == (team) then
else
rStorage.RemoteEvent3:FireClient(player)
seat.Disabled = true
wait(1)
seat.Disabled = false
end
else
print("No occupant")
end
end)

1 comment
first off make some prints so you know exacly where the error is that way it will be easier to fix