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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Teleport all players

Previous Thread :: Next Thread 
flame210 is not online. flame210
Joined: 28 Dec 2007
Total Posts: 186
06 Oct 2012 04:32 PM
I want to teleport ALL players in the game to a specific location. What peice of code do i need to use to do this?

Report Abuse
JayTheDJ is not online. JayTheDJ
Joined: 07 Aug 2011
Total Posts: 262
06 Oct 2012 04:34 PM
target = CFrame.new(0, 50, 0) --could be near a brick or in a new area
for i, player in ipairs(game.Players:GetChildren()) do
player.Character.Torso.CFrame = target + Vector3.new(0, i * 5, 0)
--add an offset of 5 for each character
end

Change the top coordinates and you're done
Report Abuse
xXTheRobotXx is not online. xXTheRobotXx
Joined: 05 May 2012
Total Posts: 13343
06 Oct 2012 04:34 PM
for i,v in pairs(game.Players:GetChildren()) do
v.Character.Humanoid:MoveTo(INSERTLOCATIONHERE)
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
06 Oct 2012 04:36 PM
@Robot actually its:

for i,v in pairs(game.Players:GetPlayers()) do
v.Character.Humanoid:MoveTo(Vector3.new(0,10,0))----insert location here
end
Report Abuse
xXTheRobotXx is not online. xXTheRobotXx
Joined: 05 May 2012
Total Posts: 13343
06 Oct 2012 04:37 PM
@Fedora

Uh no, yours is incorrect.
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
06 Oct 2012 04:40 PM
Ops, remove the humanoid, haha got u.Ufailed i won.
Report Abuse
flame210 is not online. flame210
Joined: 28 Dec 2007
Total Posts: 186
06 Oct 2012 04:43 PM
@Fedorakid

Thank you very much, yours was the one that worked AFTER I removed the humanoid part lol.
Report Abuse
luke111000 is not online. luke111000
Joined: 26 Apr 2009
Total Posts: 1853
06 Oct 2012 04:44 PM
for i,k in pairs(game.Players:GetChildren()) do
k.Character.Torso.CFrame = CFrame.new(X,Y,Z)
end

-- Live young. Enjoy life. --
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
06 Oct 2012 04:49 PM
y u guise no use getplayers method
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
06 Oct 2012 04:56 PM
I use getplayers...
Report Abuse
flame210 is not online. flame210
Joined: 28 Dec 2007
Total Posts: 186
06 Oct 2012 05:00 PM
Ok so here is a new challenge that I am having. Challenge that is for me not understanding.

After i send the message "Survive" I want the players that are alive for that round to gain "points" But if they die they stop earning points. How do i do this?

message.Text = "SURVIVE!"
?????? --Points earned durring this life go here
wait(60)
Report Abuse
flame210 is not online. flame210
Joined: 28 Dec 2007
Total Posts: 186
06 Oct 2012 05:01 PM
after the 60 seconds, all players stop earning points.
Report Abuse
jknite is not online. jknite
Joined: 30 Nov 2007
Total Posts: 614
06 Oct 2012 05:04 PM
Put an int Value within the characters. It changes if they die. Then have a script that adds points for all players with the intValue t an original amount.
When they teleport back in, switch intValue to the original value.
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
06 Oct 2012 05:04 PM
To me it doesent sound like a challenge, it sounds like ur requesting us to do all the work for u.
Report Abuse
flame210 is not online. flame210
Joined: 28 Dec 2007
Total Posts: 186
06 Oct 2012 05:08 PM
Honestly i didnt mean challenge to you guys... I appreciate the help. I have been on scripting wiki all day and have actually created a huge script so far but bits and peices of it i dont understand or the wiki wont help you with. thus its a challenge to me. I am not trying to make you guys do all the work and frankly you havent. Its only been a few lines here and there so far you guys have done and i have done lots so far. Im just not good at this so im asking when its difficult for me.
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
06 Oct 2012 05:09 PM
And if u really have this script, show me.
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
06 Oct 2012 05:11 PM
So we can have a good start helping u.
Report Abuse
flame210 is not online. flame210
Joined: 28 Dec 2007
Total Posts: 186
06 Oct 2012 05:14 PM
local Game1 = game.Lighting.Game1
while true do
wait(5)
local message = Instance.new('Hint', Workspace) -- Insert a new message in the Workspace.
message.Text = "Next Game Begins in 30 seconds" -- Set the text of the message to "Hello World!".
wait(10)
message.Text = "Teleporting players to field"
wait(2)
for i,v in pairs(game.Players:GetPlayers()) do
v.Character:MoveTo(Vector3.new(math.random(-116.2,63.57),15,76.48))----insert location here
end
message.Text = "Players Teleported"
wait(2)
message.Text = "Inserting building Materials"
wait(1)
local Game1 = Game1:Clone()
Game1.Parent = Workspace

message.Text = "Start building! Games starts in 30 seconds"
wait(25)
message.Text = "Game beginds in 5"
wait(1)
message.Text = "Game beginds in 4"
wait(1)
message.Text = "Game beginds in 3"
wait(1)
message.Text = "Game beginds in 2"
wait(1)
message.Text = "Game beginds in 1"
wait(1)
message.Text = "SURVIVE THE TOXIC WAIST!"
wait(60)
message.Text = "Game over!"
wait(3)
workspace.Game1:Remove()
message:Remove()

end


This what i have so far... and trust me this is alot to me. I learned most of this today. except the parts that have helped me
Report Abuse
blindbird17 is not online. blindbird17
Joined: 23 Jan 2012
Total Posts: 1027
06 Oct 2012 05:16 PM
target = CFrame.new(0, 50, 0) --could be near a brick or in a new area
for i, player in ipairs(game.Players:GetChildren()) do
player.Character.Torso.CFrame = target + Vector3.new(0, i * 5, 0)
--add an offset of 5 for each character
end
Report Abuse
blindbird17 is not online. blindbird17
Joined: 23 Jan 2012
Total Posts: 1027
06 Oct 2012 05:17 PM
http://wiki.roblox.com/index.php/Teleportation
Report Abuse
flame210 is not online. flame210
Joined: 28 Dec 2007
Total Posts: 186
06 Oct 2012 05:42 PM
@Fedorakid

So I posted my script like you said. So no comment?
Report Abuse
G36CSD is not online. G36CSD
Joined: 07 Aug 2011
Total Posts: 39
06 Oct 2012 06:17 PM
Idk...




workspace.idk.idk()
Report Abuse
flame210 is not online. flame210
Joined: 28 Dec 2007
Total Posts: 186
06 Oct 2012 06:27 PM
All im trying to do is that one last little peice, where after the game says "SURVIVE" the players can start earning a pont for every X amount of seconds, but if the player dies then it stops counting for them. IDK how to do this part. Thats all i need then I will be golden. or so to speak.
Report Abuse
luke111000 is not online. luke111000
Joined: 26 Apr 2009
Total Posts: 1853
07 Oct 2012 03:17 AM
Fixed it:

for i,v in pairs(game.Players:GetPlayers()) do
v.Character:MoveTo(Vector3.new(math.random(-116.2,63.57,15,76.48)----insert location here
end ]] In this chunk here the error is loacated...

v.Character:MoveTo(Vector3.new(-116.2,63.57,15,76.48))----In this line WAS the error. (-116.2,63.57),(15,76.48)---- You left brackets in uwanted places.

local Game1 = game.Lighting.Game1
while true do
wait(5)
local message = Instance.new('Hint', Workspace) -- Insert a new message in the Workspace.
message.Text = "Next Game Begins in 30 seconds" -- Set the text of the message to "Hello World!".
wait(10)
message.Text = "Teleporting players to field"
wait(2)
for i,v in pairs(game.Players:GetPlayers()) do
v.Character:MoveTo(Vector3.new(-116.2,63.57,15,76.48))----insert location here
end
message.Text = "Players Teleported"
wait(2)
message.Text = "Inserting building Materials"
wait(1)
local Game1 = Game1:Clone()
Game1.Parent = Workspace

message.Text = "Start building! Games starts in 30 seconds"
wait(25)
message.Text = "Game beginds in 5"
wait(1)
message.Text = "Game beginds in 4"
wait(1)
message.Text = "Game beginds in 3"
wait(1)
message.Text = "Game beginds in 2"
wait(1)
message.Text = "Game beginds in 1"
wait(1)
message.Text = "SURVIVE THE TOXIC WAIST!"
wait(60)
message.Text = "Game over!"
wait(3)
workspace.Game1:Remove()
message:Remove()

end

This SHOULD work.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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