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?
Use tonumber()
if player.leaderstats.Cash.Value >= tonumber(donateAmount.Text) then
Locked by NinjoOnline, Goulstem, and Muoshuu
This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.
Why was this question closed?