Basically this function repeats it’s self until it gets more than or equal to 17.
local function DealersLogic()
if DealerDeckValue >= 17 then
OpenBJUI(NewGui)
Title.Text = "The dealer has chosen to stand at a value of: "..DealerDeckValue
task.wait(3)
if DealerDeckValue > DeckValue then
Title.Text = "The dealer has won the game with a value of "..DealerDeckValue
for i,v in Connections do
v:Disconnect()
end
AlreadyBettingPlayers[player] = nil
Connections = nil
task.wait(3)
NewGui:Destroy()
elseif DealerDeckValue < DeckValue then
local EquationAmount = math.floor((Betting * 1.5) + 0.5)
Title.Text = "You have beat the dealer and won: "..EquationAmount
InvetorySystem.AddItem(player, "Casino Chips", EquationAmount)
for i,v in Connections do
v:Disconnect()
end
AlreadyBettingPlayers[player] = nil
Connections = nil
task.wait(3)
NewGui:Destroy()
else
Title.Text = "You tied and have received your "..Betting.." casino chips back!"
InvetorySystem.AddItem(player, "Casino Chips", Betting)
for i,v in Connections do
v:Disconnect()
end
AlreadyBettingPlayers[player] = nil
Connections = nil
task.wait(3)
NewGui:Destroy()
end
else
AddValue(require(game:GetService("ReplicatedStorage"):WaitForChild("Modules"):WaitForChild("RNG")).Roll(CardOdds), "", 2.5)
if DeckValue < 17 then
DealersLogic()
end
end
end
Why does it stop working?