I tried to compare 2 values and it says that it tried to compare a string to a value?
Here is the output: 12:41:21.126 - Players.tyorange09.PlayerGui.Withdraw.Bank.TextButton.LocalScript:7: attempt to compare string and number
Here is my code (Local Script): script.Parent.MouseButton1Click:Connect(function()
local player = game.Players.LocalPlayer
local CashAmount = script.Parent.Parent.TextButton.Text
01 | if player.Pstats.Bank.Value > CashAmount then |
03 | player.Pstats.Bank.Value = player.Pstats.BankCash.Value - CashAmount |
05 | player.Pstats.Cash.Value = player.Pstats.Cash.Value + CashAmount |
07 | script.Parent.Parent.Visible = false |
11 | if player.Pstats.BankCash.Value < CashAmount then |
13 | script.Parent.Parent.TextBox.Text = "Incuficent Balance!" |
15 | script.Parent.Parent.TextBox.BackgroundColor 3 = "#ff0000" |
end)