So I’m using this group teleport script (not made by me) and although it works to teleport it does not display a countdown. I’ve searched the forums and YouTube but I can’t find any that are helpful. How would I make it so it displays a countdown at the top of the screen?
for i = 5,1,-1 do
if num < 1 then break end
if num == #seats:GetChildren() then break end
wait(1)
end
What you’ll want to do is have a RemoteEvent in ReplicatedStorage and a LocalScript in the TextLabel.
Inside the LocalScript you’ll want to update the TextLabel OnClientEvent of the RemoteEvent and display the given value:
local remote = game:GetService("ReplicatedStorage"):FindFirstChild("RemoteEvent")
remote.OnClientEvent:Connect(function(value)
script.Parent.Text = value
end)
Now that’s all setup, you can FireAllClients and display the current time:
local remote = game:GetService("ReplicatedStorage"):FindFirstChild("RemoteEvent")
for i = 5,1,-1 do
if num < 1 then break end
if num == #seats:GetChildren() then break end
remote:FireAllClients(tostring(i))
wait(1)
end