So i was experimenting and i made a gambling mechanic, but when i tested it out i would "win" but it would still say i lost, and i thought i would ask here why.
It all mainly happens at the end of the code
local brick = script.Parent
local ClickDectector = brick.ClickDetector
local InUse = false
ClickDectector.MouseClick:connect(function(player)
local Money = player.leaderstats.Money
if InUse == false then
if Money.Value >= 10 then
InUse = true
Money.Value = Money.Value - 10
for Gamble = 1,10 do
wait(.1)
print(Gamble)
brick.BrickColor = BrickColor.Random()
end
print("The Pointer Landed On: ")
print(brick.BrickColor)
if brick.BrickColor == "Really red" then
print("U WIN")
Money.Value = Money.Value + 1000
else
print("you lose hah")
end
InUse = false
end
if brick.BrickColor == "Really blue" then
print("U WIN")
Money.Value = Money.Value + 1000
else
print("you lose hah")
end
end
end)
