I am currently developing a game and for some reason my timer gui wont show up and count down here is my script...
COT = game.ReplicatedStorage.CorruptedTimer.Value TCO = script.Parent gameie = game.ReplicatedStorage.Game.Value local mytable = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20} if gameie == 5 then TCO.Visible = true for i, v in pairs(mytable) do TCO.Text = COT COT = COT -1 end TCO.Visible = false end
any other methods of triggering an event that makes a timer run????
Just make a variable, you don't need a table. Do a variable and a while true do. And also you need to change the Text of the GUI.
local yourGUI = script.Parent --Set your ScreenGUI or Frame. local guiText = yourGUI.Text gameie = game.ReplicatedStorage.Game.Value local timer = 20 if gameie == 5 then yourGUI.Enabled = true --Do Visible or change the transparency if it isnt a ScreenGUI. while true do wait(1) timer -= 1 if timer == 0 then break yourGUI.Enabled = false end end end
I really hope this works and helped! At least you have an idea of how to do it.
Try this, when the game value in replicated changes it will update the function, you was only running the if statement once, and after that one time it would return false and not go ahead
COT = game.ReplicatedStorage.CorruptedTimer.Value TCO = script.Parent gameie = game.ReplicatedStorage.Game gameie.Changed:Conect(function() if gameie.Value == 5 then TCO.Visible = true for i = 20,1,-1 do TCO.Text = COT COT = COT -1 wait(1) end TCO.Visible = false end end)
use a if statement
COT = game.ReplicatedStorage.CorruptedTimer.Value TCO = script.Parent gameie = game.ReplicatedStorage.Game.Value local mytable = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20} if gameie == 5 then TCO.Visible = true for i, v in pairs(mytable) do TCO.Text = COT COT = COT -1 if COT == 0 then TCO.Visible = false end end