So the part of script when number is 1 is working great, but when its 2 its dont work. Output dont say anything. Please i beg you for help! Script:
local text = game.Workspace.LuckyMonitor.SurfaceGui["Try Luck!"]
local luck = game.Workspace.Luck
local fail = game.Workspace.Fail
local cooldown = false
script.Parent.ClickDetector.MouseClick:Connect(function()
if cooldown == false then
cooldown = true
text.Text = "Wait"
wait(5)
--WORKING PART!
local chance = math.random(1,2)
if chance == 1 then
text.Text = "Lucky!"
text.TextColor3 = Color3.new(0, 1, 0)
if not luck.IsPlaying then
luck:Play()
print("LUCK!")
wait(3)
text.Text = "Try Your Luck"
text.TextColor3 = Color3.new(0,0,0)
cooldown = false
--NOT WORKING PART!
else
if chance == 2 then
text.Text = "Failure!"
text.TextColor3 = Color3.new(1, 0, 0)
if not fail.IsPlaying then
fail:Play()
print("Fail")
wait(3)
text.Text = "Try Your Luck"
text.TextColor3 = Color3.new(0,0,0)
cooldown = false
end
end
end
end
end
end)

1 comment
Thanks may try it later, can you rewrite the scripts? :D