Pls help with the error

pls dont hate if this code is sh*t im just new

local RS = game.ReplicatedStorage
local Remote = RS.Remotes:WaitForChild("UpgradeMulti")

local Player = game.Players.LocalPlayer

local Cash = Player.leaderstats.Cash
local Multi = Player.Multi

local UpgradeButton = script.Parent

UpgradeButton.MouseButton1Click:Connect(function()
	if Cash.Value >= 2 and Multi.Value == 1 then
		Multi.Value *= 2
		Cash.Value -= 2
	end
end)

it gives me this error:Players.SANYAA_BL9.PlayerGui.StatsGui.Frame.CashUpgrade.TextButton.LocalScript:12: attempt to compare number <= string

1 Like

is the Cash value a StringValue? if yes then replace it with a NumberValue or use tonumber

if tonumber(Cash.Value) >= 2 and Multi.Value == 1 then
1 Like

I think you are accidentally using a StringValue instead of a NumberValue you might need to swap that out.

Is it possible that your Cash/Multi value is a stirng value instead of a number value? A string value is a text, a number value is a float.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.