i have a script here for my wall jumping test, and once i fire the remote event to let the local script know that i can jump off of the wall, it stills lets me infinitely jump and it is really annoying.

Can someone find a fix?

script:

local remote = game.ReplicatedStorage:WaitForChild("WalljumpEnabled")
local plr = game.Players.LocalPlayer
local humanoid = plr.Character:WaitForChild("Humanoid")
local uis = game:GetService("UserInputService")

local canJump = false

remote.OnClientEvent:Connect(function()
	canJump = true
	if canJump == true then
		uis.JumpRequest:Connect(function()
				humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
				remote:FireServer()
				canJump = false
			end)
		end
	end)