Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would I make the timer not be visible after the countdown is finished? [closed]

Asked by 4 years ago
wait()

local mFloor = math.floor 
local Next = next 
local Tick = tick 
local Wait = wait 
local Stop = 0

while true do Wait(1) 
wait()
local Time = 1589098260 - Tick() 
local Days = mFloor((Time / 60 / 60 / 24) % (365 + 0.2425)) 
local Hours = mFloor((Time / 60 / 60) % 24) 
local Minutes = mFloor((Time / 60) % 60) 
local Seconds = mFloor(Time % 60) 

if Stop == 0 then

script.Parent.Time.Text = Days.."D "..Hours.. "H "..Minutes.."M "..Seconds.."S"
end

if Days==0 and Hours==0 and Minutes==0 and Seconds==0 then
Stop=1
script.Parent.Time.Text = "Live Event"

if Days==0 and Hours==0 and Minutes==0 and Seconds==0 then -- This did not work
game.StarterGui.Countdown.Frame.Visible = false

end
end

end 

Closed as Non-Descriptive by User#29913, youtubemasterWOW, and itz_rennox

This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 4 years ago

I Think I fixed it :D

wait()

local mFloor = math.floor 
local Next = next 
local Tick = tick 
local Wait = wait 
local Stop = 0

while true do Wait(1) 
wait()
local Time = 1589099520 - Tick() 
local Days = mFloor((Time / 60 / 60 / 24) % (365 + 0.2425)) 
local Hours = mFloor((Time / 60 / 60) % 24) 
local Minutes = mFloor((Time / 60) % 60) 
local Seconds = mFloor(Time % 60) 

if Stop == 0 then

script.Parent.Time.Text = Days.."D "..Hours.. "H "..Minutes.."M "..Seconds.."S"
end

if Days==0 and Hours==0 and Minutes==0 and Seconds==0 then
Stop=1
script.Parent.Time.Text = "Live Event"

wait(2)
     script.Parent:Destroy()

     end 

end
Ad