(help with simple script) How do I toggle double jump on and off?

WHOEVER HELPS ME FIX THIS GETS SOLUTION 100% GUARENTEED! this is urgent that i fix this

I’m making a double jump gamepass that has a button you can press to toggle it on or off. I have the double jump system done so if I were to just use that double jump system then everyone could use it. But I want to make a button that detects if the player has the gamepass by using

if MarketplaceService:UserOwnsGamePassAsync(Player.UserId, 123)

if they have the gamepass then the double jump is toggled on

heres what i have so far

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

local Button = script.Parent
local RemoteEvent = game.ReplicatedStorage.ActivateDoubleJump

if MarketplaceService:UserOwnsGamePassAsync(Player.UserId, 185857200) then
	
	script.Parent.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
	
	script.Parent.Text = 'ENABLE DOUBLE JUMP'

else
	
	script.Parent.BackgroundColor3 = Color3.fromRGB(0, 166, 255)
	
	script.Parent.Text = 'BUY DOUBLE JUMP'

end

Button.MouseButton1Click:Connect(function()

	if MarketplaceService:UserOwnsGamePassAsync(Player.UserId, 185857200) then
		
		RemoteEvent:FireServer()
		
	else
		
		MarketplaceService:PromptGamePassPurchase(game.Players.LocalPlayer, 185857200)
		
	end

end)

RemoteEvent.OnClientEvent:Connect(function(DoubleJumpState)
	
	if DoubleJumpState == true then
		
		script.Parent.BackgroundColor3 = Color3.fromRGB(0, 255, 0)
		
		script.Parent.Text = 'DOUBLE JUMP: ON'
	
	else
		
		script.Parent.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
		
		script.Parent.Text = 'DOUBLE JUMP: OFF'
	
	end
end)

and i have a serverscript thats in serverscriptservice

local MarketplaceService = game:GetService("MarketplaceService")

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

local DoubleJumpLocal = game.StarterPlayer.StarterCharacterScripts.DoubleJumpLocal

DoubleJumpLocal.Enabled = false

local PlayersWithDoubleJump = {} -- Table Containing People With Double Jump Enabled

-- Table Check

local function checkTableForValue(t, value)

	for i, v in pairs(t) do

		if v == value then

			return i
		end
	end

	return false

end

-- Double Jump Handler

game.ReplicatedStorage['ActivateDoubleJump'].OnServerEvent:Connect(function(p)
	
	if MarketplaceService:UserOwnsGamePassAsync(p.UserId, 185857200) then
		
		if checkTableForValue(PlayersWithDoubleJump, p) ~= false then
			
			table.remove(PlayersWithDoubleJump, checkTableForValue(PlayersWithDoubleJump, p))
			
			DoubleJumpLocal.Enabled = false
			
		else
			
			table.insert(PlayersWithDoubleJump, p)
			
			DoubleJumpLocal.Enabled = true
			
		end
		
	end
	
end)

how do i make a button that enables and disables the double jump if they have a gamepass

I would like a bit more than100% SOLUTION lol but this should help

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

local Button = script.Parent
local RemoteEvent = game.ReplicatedStorage.ActivateDoubleJump
local DoubleJumpEnabled = false

-- Function to update button appearance based on double jump state
local function updateButtonState()
    if DoubleJumpEnabled then
        script.Parent.BackgroundColor3 = Color3.fromRGB(0, 255, 0)
        script.Parent.Text = 'DOUBLE JUMP: ON'
    else
        script.Parent.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
        script.Parent.Text = 'DOUBLE JUMP: OFF'
    end
end

-- Check if player owns the gamepass on startup
if MarketplaceService:UserOwnsGamePassAsync(Player.UserId, 185857200) then
    DoubleJumpEnabled = true
end
updateButtonState()

-- Button click event
Button.MouseButton1Click:Connect(function()
    if MarketplaceService:UserOwnsGamePassAsync(Player.UserId, 185857200) then
        DoubleJumpEnabled = not DoubleJumpEnabled
        updateButtonState()
        RemoteEvent:FireServer(DoubleJumpEnabled) -- Pass the state to the server
    else
        MarketplaceService:PromptGamePassPurchase(Player, 185857200)
    end
end)

i have a localscript in startercharacterscripts that is the double jump script so what can i do to make that disabled if they dont have the gamepass or if the button is toggled off and if the button is toggled on then they get it

and i will give you 1000% solution haha