So I was trying to make a button green if the player has enough money and gray, if the player doesn't have enough money. The problem is, I can't compare his money value and the price of the item. The code looks like this:
-- Script
game.Players.PlayerAdded:connect(function(plr)
local money = plr:WaitForChild("leaderstats").Money.Value
local bicyclePrice1T = math.random(2, 20) * 5
bicyclesImage.MouseButton1Down:connect(function()
if money >= bicyclePrice1T then
bBuyButton1A.BackgroundColor3 = BrickColor.Green().Color
else
bBuyButton1A.BackgroundColor3 = BrickColor.Gray().Color
end
end)
end)
And it shows me this error:
10:33:09.862 - ServerScriptService.InternetScript:491: attempt to compare number with userdata
Thanks for reading

2 comments
What is bicyclePrice1T ?
Sorry, forgot about it, now it's in the script