When I get the Transparency of 1, the script works well and repeats. When I get 0, no matter how many times I click the script fails to execute again. What do I do? Thank you.
math.randomseed(tick())
local sp = script.Parent
local debounce = false
sp.ClickDetector.MouseClick:connect(function()
print("pressed")
if not debounce then
debounce = true
sp.Transparency=math.random(0,1)
wait(2.5)
if sp.Transparency == 1 then
workspace.givecandy.Value = true
wait(5)
workspace.givecandy.Value = false
sp.Transparency = 0
debounce = false
elseif sp.Transparency == 0 then
wait(1)
print("not awake")
game.Workspace.grunt:Play()
game.Workspace.dialog2.d2.Transparency = 0
wait(3)
game.Workspace.dialog2.d2.Transparency = 1
end
end
end)
