donateButton.MouseButton1Down:connect(function(donate)
if game.Players:FindFirstChild(playerName.Text) then
local donatePlayer = playerName.Text
print("PLAYER FOUND")
if player.leaderstats.Cash.Value >= donateAmount.Text then -- ERROR HERE
print("GOOD AMOUNT")
player.leaderstats.Cash.Value = player.leaderstats.Cash.Value - donateAmount.Text
donatePlayer.leaderstats.Cash.Value = donatePlayer.leaderstats.Cash.Value + donateAmount
end
end
end)
PLAYER FOUND 10:55:29.674 - Players.Player.PlayerGui.HUD.DonateFrame.DonateScript:29: attempt to compare string with number 10:55:29.675 - Stack Begin 10:55:29.676 - Script 'Players.Player.PlayerGui.HUD.DonateFrame.DonateScript', Line 29 10:55:29.677 - Stack End
Everything has been defined so don't worru about that. How can I get the string to compare with a number?

1 comment
Warning:
tonumberwill returnnilif you didn't get it text that precisely represents a number!