✓ Accepted answer
The error describes exactly what you're doing wrong.
tonumber(Text) will return a number representation of Text. HBid, I'm assuming, is a string. How can a number be greater than a string (without getting into certain technicalities)? It can't. A number is a number, and a string is a string. What I think you did was that you used a StringValue for HBid when you should've been using an IntValue.
Additionally, I've noticed another mistake. You do:
local HBidder = workspace.HighestBidder.Value
local HBid = workspace.HighestBid.Value
and then later on, you try changing their values by doing
HBid = Text
HBidder = Player
That will not change their values. Initially, HBidder and HBid are not a reference to HighestBidder.Value and HighestBid.Value but rather strings whose values are equal to their values. Whenever you want to change ValueBase objects, you must refer to their object first and then assign a change to their Value property, so it should be more like this:
local HBidder = workspace.HighestBidder
local HBid = workspace.HighestBid
HBid.Value = Text
HBidder.Value = Player
Same thing if you want to check the Value. You must check HBidder.Value rather than HBidder and HBid.Value rather than HBid.
5 comments
Please accept my friend request. I love you, no homo. You know what you’re doing, most deprecated code using geeks never get the message I give them into their brains. (This guy didn’t use deprecated code but others).
everything goes okay until i get error "attempt to compare userdata with number" in line 10 -_-
Are you using 'HBid' or 'HBid.Value' to compare?
compare?
Like check its value in an if-statement.