I already have a GUI Countdown script that looks like this
local this = Instance.new("IntValue", game.Workspace) this.Value = 300 --Change 300 to round seconds this.Name = "Timer" _G.timer = this while true do _G.timer.Value = 300 --Change 300 to round seconds for 5 minutes repeat _G.timer.Value = _G.timer.Value - 1 wait(1) until _G.timer.Value == 0 end
But I need it to teleport it to a certain brick after its done counting down
Here is a way to make your life easier, Make one MAIN SCRIPT for your game it's much easier, Make a ScreenGui with a TextLabel. Then put a StringValue into ReplicatedStorage name it StatusValue, Put this script into the TextLabel.
ReplicatedStorage = game:GetService("ReplicatedStorage") Status = ReplicatedStorage.StatusValue script.Parent.Text = Status.Value Status.Changed:connect(function() script.Parent.Text = Status.Value end)
Then you put a Regular Script into workspace and write your code in there, So let me get you started with your countdown.
ReplicatedStorage = game:GetService("ReplicatedStorage") Status = ReplicatedStorage.StatusValue for i = 300,1,-1 do -- Change 15 to how long you want to countdown Status.Value = i wait(1) end for _. player in pairs(game.Players:GetPlayers()) do player.Character.Torso.CFrame = CFrame.new(Spawn.Location) -- If you are loading a map then put a brick called **Spawn ** if not either put the position of a brick or 'game.Workspace.Brick.Position' end end
I have not checked this but it should work, If it doesn't work then I might've did something wrong. Hope this helps!!