Help with proximity prompt backpack space script

Im not really that good at scripting yet however, I do know a little. I tried using the new proximity prompt feature to make it so you get 1 point per usage and if your “Slimed” value is the same as the max backpack space value, then the proximity prompt which is in the workspace and is a child of a part called proxpart disables. It does that however, after you sell or get no longer have greater than or equal to max backpack space the proximity prompt doesn’t enable again. I have a leaderstats in another script its set up perfectly fine so I don’t think there is any problem with that backpackMax is in the player on purpose too.

local plr = game.Players.LocalPlayer


game.Workspace.proxpart.ProximityPrompt.TriggerEnded:Connect(function(player)


	if player.leaderstats.Slimed.Value >= player.backpackMax.Value then
		game.workspace.proxpart.ProximityPrompt.Enabled = false
		local slimegive = 0
		player.leaderstats.Slimed.Value = player.leaderstats.Slimed.Value + slimegive

	elseif player.leaderstats.Slimed.Value < player.backpackMax.Value then
		game.workspace.proxpart.ProximityPrompt.Enabled = true
		local slimegive = 1
		player.leaderstats.Slimed.Value = player.leaderstats.Slimed.Value + slimegive
	end


end)

Can you show us some output from prints of values changed in the script.

image

	elseif player.leaderstats.Slimed.Value < player.backpackMax.Value then
		game.workspace.proxpart.ProximityPrompt.Enabled = true
		local slimegive = 1
		player.leaderstats.Slimed.Value = player.leaderstats.Slimed.Value + slimegive
		print(player.leaderstats.Slimed.Value.." S")
		print(player.backpackMax.Value.." B")
	end


end)

Sure, I dont see any problems with it tho

Thanks for those prints.
What is the value of game.workspace.proxpart.ProximityPrompt.Enabled during those changes?
I am expecting it to go from false to true and stay there.