I already have this code answered
local Inter = Instance.new("IntValue") -- Creates the Value Inter.Parent = game.Workspace Inter.Name = ("Intermission") Inter.Value = 10 while Inter.Value > 0 do wait(1) Inter.Value = Inter.Value - 1 end
(Which is this one) - AnsweredCodeForum
1.But my main question is to get the TextLabel to follow what the Value of the IntValue no matter what. (COMPLETE)
Here is the ScreenGUI that has the TextLabel
2.Next thing is how would I repeat the process after a round is over? For example a round lasted for sixty seconds, then the IntValue will countdown to 10 (Which is the Intermission Value). After it counts, it does it again and again.
Was using RemoteEvent should have been using RemoteFunction
This is compatible with FilteringEnabled
In a Script in game.Workspace
IntermissionTime = 10 RoundTime = 60 IntermissionString = "Intermission: %s" -- can be any string, put %s where you want the time to be displayed RoundString = "Time Left: %s" -- can be any string, put %s where you want the time to be displayed GetTime = Instance.new("RemoteFunction") GetTime.Name = "GetTime" GetTime.Parent = game.Workspace function GetTime.OnServerInvoke() local T = {} table.insert(T, String) table.insert(T, CurrentTime) return T end function CountTime() while CurrentTime > 0 do wait(1) CurrentTime = CurrentTime -1 end end while wait() do String = IntermissionString CurrentTime = IntermissionTime CountTime() String = RoundString CurrentTime = RoundTime CountTime() end
In a LocalScript in RoundInfo.Frame
repeat wait() until game.Workspace:FindFirstChild("GetTime") while wait() do T = game.Workspace.GetTime:InvokeServer() script.Parent.Countdown.Text = string.format(T[1], T[2]) end