I'm trying to make a script (and I'm fairly new to this) that when run, would make a black screen, wait a while, then take the screen away.
Here it is:
local function darknessCycle()
local darknessClone = game.ServerStorage.Darkness:Clone()
darknessClone.Name = ("darknessClone")
darknessClone.Parent = game.StarterGui
local darknessTimer = 0
math.randomseed(tick())
wait(0.5)
local darknessTime = math.random(2,10)
for _ = 1, darknessTime, 1 do
darknessTimer = darknessTimer + 1
wait(1)
print(darknessTime)
print(darknessTimer)
end
print ("darknessTimer finished")
darknessClone:Destroy() -- ??????
end
The thing is, when the script is run, and the darknessClone is destroyed, the black screen still stays. Is there something I'm missing that I need to get rid of it?

1 comment
By the way, I am aware that the function hasn't been called. When it is, it won't work.