generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Timer countdown

Previous Thread :: Next Thread 
9draco is not online. 9draco
Joined: 13 Nov 2010
Total Posts: 5841
21 Mar 2015 10:37 PM
Is there a way to teleport all the players in the field to the lobby once countdown reaches 0?
Report Abuse
amanda is not online. amanda
Joined: 21 Nov 2006
Total Posts: 5925
21 Mar 2015 10:39 PM
Yes, however if they are in the same script you don't need to put all the if's and but's, you just need to put one after the other

print("teleportation will commence after countdown")
for i = 10, 1, -1 do
wait(1)
print(i)
end
print("teleporting players")
Report Abuse
amanda is not online. amanda
Joined: 21 Nov 2006
Total Posts: 5925
21 Mar 2015 10:41 PM
however, if you want it to reach 0, simply do

for i = 10, 0, -1 do
print(i)
wait(1)
end
Report Abuse
9draco is not online. 9draco
Joined: 13 Nov 2010
Total Posts: 5841
21 Mar 2015 10:48 PM
So once the timer reaches 0, it will teleport all players to the lobby? Doesnt that need a position vector or something like that?
Report Abuse
CrowClaws is not online. CrowClaws
Joined: 04 Jul 2010
Total Posts: 4466
21 Mar 2015 10:53 PM
lern2skript
She gave you the tools
Report Abuse
Klink45 is not online. Klink45
Joined: 06 Jun 2011
Total Posts: 26054
21 Mar 2015 10:55 PM
Yeah, remove the print part and change that to your code.
Report Abuse
9draco is not online. 9draco
Joined: 13 Nov 2010
Total Posts: 5841
21 Mar 2015 10:56 PM
Ok so I have a rough idea. Tell me if im correct or not. Should I add a teleportation code to the location I want after the countdown script?
Report Abuse
amanda is not online. amanda
Joined: 21 Nov 2006
Total Posts: 5925
21 Mar 2015 10:57 PM
I didn't write the entire script for you, I simply gave you the structure, the print statements are suppose to give a simulation of how it works.

If you run the code I gave you in a script, it will print the first statement, count down from 10, and then print the last statement. What is crucial here, is it maintains the order.

So, you would replace the last print statement with your mass-teleport script, and it will countdown from 10, and once it reaches 0, teleport everyone. I did not provide any means for transporting players, it was implied you can do that on your own.
Report Abuse
superconscript is not online. superconscript
Joined: 15 Mar 2012
Total Posts: 413
21 Mar 2015 10:58 PM
Just use a for loop and have a part called spawn (try this in localscript probs might not work but it might)
spawn = workspace.spawn
character = game.Player.LocalPlayer.Character
countdowntime = 100
i = 1
repeat wait(1) i = i + 1 until i == countdowntime
character:MoveTo (spawn.Position)


Report Abuse
amanda is not online. amanda
Joined: 21 Nov 2006
Total Posts: 5925
21 Mar 2015 10:59 PM
yup

add the teleport script right after the countdown

scripts are good at going in order, so you can take advantage of that by just slapping a countdown above it so it reads it first.
Report Abuse
9draco is not online. 9draco
Joined: 13 Nov 2010
Total Posts: 5841
21 Mar 2015 11:22 PM
So I should add my teleport script after
character:MoveTo (spawn.Position)
?
Report Abuse
9draco is not online. 9draco
Joined: 13 Nov 2010
Total Posts: 5841
21 Mar 2015 11:41 PM
Is that correct? ^^^
Report Abuse
amanda is not online. amanda
Joined: 21 Nov 2006
Total Posts: 5925
21 Mar 2015 11:43 PM
how am i suppose to know

try it out

how do you expect to figure anything out if you don't mess up

and don't come here every time your script breaks

watch tutorials, actually learn instead of using this subsection as a crutch

we are here to help, but we aren't here to write your script for you
Report Abuse
superconscript is not online. superconscript
Joined: 15 Mar 2012
Total Posts: 413
21 Mar 2015 11:46 PM
FYI the character:MoveTo (spawn.Position) was my teleport to the lobby spawn part
so you name a part named spawn and that is where they will return.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image