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

How to teleport after countdown?

Asked by 8 years ago

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

1 answer

Log in to vote
-1
Answered by 8 years ago
Edited 8 years ago

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!!

0
The script just says 300 and stays at 300 and doesnt countdown Glassify 15 — 8y
0
I just noticed that there are a phew mistakes in the script I will fix them now, Please remove my vote. PixelZombieX 8 — 8y
Ad

Answer this question