So I'm trying to check if the player has enough to bet before it takes their coins. The check keeps sending an error. I have done this same check on several other things but this one errors. Can anyone help?
local Player = game.Players.LocalPlayer local Sample = script.Sample local Bet = script.Parent.Bet.Input.Text local Accept = script.Parent.Accept local Players = script.Parent.Players.ScrollingFrame local Timer = script.Parent.Timer local Total = script.Parent.Total local Decrement = game.ReplicatedStorage.Events.Decrement Accept.MouseButton1Click:Connect(function() if Bet.Text ~= "" then if Player.Cash.Value >= tonumber(Bet.Text) then -- This is sending the error. Decrement:FireServer("Cash",tonumber(Bet.Text)) local Clone = Sample:Clone() Clone.Parent = Players Clone.Username.Text = Player.Name Clone.Bet.Text = "$" .. Bet.Text end end end)
Checking for amount
if cash => "*AMOUNT HERE*" then elseif cash <= print (Not enough money)
Found the issue nvm lol When I made the bet variable I put in
local Bet = script.Parent.Bet.Input.Text
instead of
local Bet = script.Parent.Bet.Input
So when I was calling "Bet.Text" in the if statment it was searching for Text.Text lol