This is my script, it always chooses "0", meaning the door's transparency will remain 0. I've tested it many times and it just doesn't seem to ever open the door. I understand random can sometimes repeat but, this is ridiculous. Any help? Do you see any errors I have skipped over in the last hour? Thank you.
sp=script.Parent
sp.ClickDetector.MouseClick:connect(function()
math.randomseed(tick())
sp.Transparency=math.random(0,1)
wait(3)
if sp.Transparency==1 then
game.Workspace.givecandy.Value = true
wait(5)
if sp.Transparency==1 then
sp.Transparency = 0
game.Workspace.givecandy.Value = false
end
else
print("not awake")
end
end)
Again, no errors are shown in output, but if you see any I may have missed anyway please tell me. Or perhaps, I wrote the script wrong? Thank you again..

2 comments
thanks, I see what I did wrong :)
No problem, thanks for the thumbs up.