How tp make ProximityPrompt Off when Player Sit on Seat and On when Jump off Seat

I ask AI aka Assistant To Script for me [Because am noob as Coding]

“how to localscript player seat and all ProximityPrompt will off ClickablePrompt, if player jump out Seat all ProximityPrompt will on like normal” [LocalScript because i want single player]

and here is Script i dont… understand:

local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
local ProximityPrompts = {}

-- Function to toggle the ClickablePrompt property of all ProximityPrompts
local function toggleProximityPrompts(state)
    for i, prompt in ProximityPrompts do
        if prompt:IsA("ProximityPrompt") then
            prompt.ClickablePrompt = state
        end
    end
end

-- Function to collect all ProximityPrompts in the Workspace
local function collectProximityPrompts()
    for i, descendant in game.Workspace:GetDescendants() do
        if descendant:IsA("ProximityPrompt") then
            table.insert(ProximityPrompts, descendant)
        end
    end
end

-- Collect all ProximityPrompts initially
collectProximityPrompts()

-- Monitor the player's seating state
character.Humanoid.Seated:Connect(function(isSeated, seat)
    if isSeated then
        toggleProximityPrompts(false)
    else
        toggleProximityPrompts(true)
    end
end)

-- Ensure ProximityPrompts are toggled correctly if the player respawns
LocalPlayer.CharacterAdded:Connect(function(newCharacter)
    character = newCharacter
    character:WaitForChild("Humanoid").Seated:Connect(function(isSeated, seat)
        if isSeated then
            toggleProximityPrompts(false)
        else
            toggleProximityPrompts(true)
        end
    end)
end)

And LocalScript i put on StarterPlayerScripts
image
Can Anybody Explain and How Fix it?

Did you try searching around?
Use this to turn off proximities when detected

That not what i mean, i need somehow The E to Sit gone on my near seat

,
And if i Press E to Sit that it will Gone forever

Again, use the detection in your seats to disable this. Go through all the seats and disable the proximity for the local player.

Hey, how are you? Well, I hope you’re doin’ good. I’ve just written a code for you. I hope it will work.

local BWorkspace = game:GetService("Workspace")

local Players = game:GetService("Players")
local Player = Players.LocalPlayer

local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:FindFirstChildOfClass("Humanoid")

local ProximityPrompts =  {}
for _, ProximityPromt in BWorkspace:GetDescendants() do
	if ProximityPromt:IsA("ProximityPrompt") then
		table.insert(ProximityPrompts, ProximityPromt)
	end
end

local function ProximityPromtActivation(State)
	for _, ProximityPromt in BWorkspace:GetDescendants() do
		if ProximityPromt:IsA("ProximityPrompt") then
			ProximityPromt.Enabled = not State
		end
	end
end

Humanoid.Seated:Connect(function(IsSeated)
	ProximityPromtActivation(IsSeated)
end)

According to my code, you must put the script in the StarterCharacterScripts. Actually, when you die your character just becomes copied and you lose all children. So, that’s why you must put the script in StarterCharacterScripts.

If the script does not work, please reply to me. Have a nice day!