ProximityPrompt Shop

I am making a shop of ProximityPrompts, yet for some reason it doesn’t work, giving an error code saying

attempt to compare Instance <= number on line 3

script.Parent.ProximityPrompt.Triggered:Connect(function(plr)
	local points = plr.leaderstats.points
	if points.Value >= script.Parent.Price then
		points.Value = points.Value - script.Parent.Price
		local storage = game:GetService("ServerStorage")
		
		for _, tool in pairs(plr.Backpack:GetChildren()) do
			if tool:IsA("Tool") then
				tool:Destroy()
			end
		end
		for _, tool in pairs(plr.StarterGear:GetChildren()) do
			if tool:IsA("Tool") then
				tool:Destroy()
			end
		end
		storage[script.Parent.WName]:Clone().Parent = plr.Backpack
		storage[script.Parent.WName]:Clone().Parent = plr.StarterGear
		script.Parent.Reciept:Clone().Parent = plr.PlayerGui
		plr.leaderstats.weapon.Value = script.Parent.WName
	end
end)

Any help?

try replacing

	if points.Value >= script.Parent.Price then

with

	if points.Value >= script.Parent.Price.Value then

Do you mean to do

if points.Value >= script.Parent.Price.Value then
1 Like