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: Need help teleporting all players into arena.

Previous Thread :: Next Thread 
Crazy_Coconut13 is not online. Crazy_Coconut13
Joined: 19 Jun 2016
Total Posts: 7
28 Jun 2016 11:46 PM
Hey guys,

I've started making my first Roblox game today and i have the basic mechanics working a treat but i need a way to teleport all the players into the arena when the game starts. What is the best way of doing this?

P.S. I know this would be simple for a lot of the people on here but as i said im new to making games in Roblox. Thanks in advance!
Report Abuse
unwarranted is not online. unwarranted
Joined: 05 Jun 2009
Total Posts: 1087
28 Jun 2016 11:47 PM
for _,player in pairs(game.Players:GetChildren()) do
player.Torso.CFrame = ---Put your cframe here
end

this should preferably be in a localscript


mom wheres the spaghetti | R$18,851
Report Abuse
Crazy_Coconut13 is not online. Crazy_Coconut13
Joined: 19 Jun 2016
Total Posts: 7
28 Jun 2016 11:52 PM
Alright, thanks for the help!
Report Abuse
ShadyThesauri is not online. ShadyThesauri
Joined: 07 Jul 2011
Total Posts: 87
28 Jun 2016 11:54 PM
@unwarranted

depending on how many people are being moved, wouldn't that potentially send a lot of people flying?


Report Abuse
Codons is not online. Codons
Joined: 25 Feb 2016
Total Posts: 273
29 Jun 2016 12:00 AM
Have parts in a model named "Spawns"

local spawns = workspace.Spawns:GetChildren()
local players = game.Players:GetPlayers()

for i, v in pairs(players) do
if v.Character then
v.Character.Torso.CFrame = spawns[i].Position
end
end


Report Abuse
Casualist is not online. Casualist
Joined: 26 Jun 2014
Total Posts: 4443
29 Jun 2016 12:02 AM
Have parts in a model named "Spawns"

local spawns = workspace.Spawns:GetChildren()
local players = game.Players:GetPlayers()

for i, v in pairs(players) do
if v.Character then
v.Character:MoveTo(spawns[i%#spawns + 1].Position)
end
end
Report Abuse
BodyRipped is not online. BodyRipped
Joined: 30 Jul 2013
Total Posts: 29071
29 Jun 2016 12:14 AM

function onTouched(hit)
local human = hit.Parent:findFirstChild("Humanoid")
if human.Health == 100
then human.Health = 0



end
end

script.Parent.Touched:connect(onTouched)


Thank me later


Report Abuse
Crazy_Coconut13 is not online. Crazy_Coconut13
Joined: 19 Jun 2016
Total Posts: 7
29 Jun 2016 03:20 AM
Well, I dont understand most of the code you guys are talking about because all i have currently used in my game are if statement and changing the properties of different bricks so it would be really appreciated if someone could just give me a final piece of code and tell me everything i need to do to to make it work.
Report Abuse
Adstract is not online. Adstract
Joined: 13 Sep 2015
Total Posts: 3342
29 Jun 2016 03:41 AM
just use the first code but to stop players flying distance the players

i = 0

for _,player in pairs(game.Players:GetChildren()) do
i = i + 0.3
player.Torso.CFrame = (x + i, y + i, z) ---Put your cframe here
end



Report Abuse
Crazy_Coconut13 is not online. Crazy_Coconut13
Joined: 19 Jun 2016
Total Posts: 7
29 Jun 2016 04:49 AM
ok, ill try it out
Report Abuse
Crazy_Coconut13 is not online. Crazy_Coconut13
Joined: 19 Jun 2016
Total Posts: 7
29 Jun 2016 05:01 AM
I got this error message
ServerScriptService.Script:20: ')' expected near ','

line 20 is

player.Torso.CFrame = (0 + i, 75 + i, 0)
Report Abuse
DurstAuric is online. DurstAuric
Joined: 12 May 2009
Total Posts: 8066
29 Jun 2016 05:09 AM
Paste your script, because we don't see a line 20 here.


-=[ RAP: 344,064 || DurstAuric; the narb of ROBLOX ]=-
Report Abuse
Lem0nzzx is not online. Lem0nzzx
Joined: 08 Feb 2016
Total Posts: 1604
29 Jun 2016 05:19 AM
player.Torso.CFrame = CFrame.new(0 + i, 75 + i, 0)



Report Abuse
Crazy_Coconut13 is not online. Crazy_Coconut13
Joined: 19 Jun 2016
Total Posts: 7
29 Jun 2016 05:54 AM
that fixed that but now i get:

- Torso is not a valid member of Player

i = 0
for _,player in pairs(game.Players:GetChildren()) do
i = i + 0.3
player.Torso.CFrame = CFrame.new(0 + i, 75 + i, 0)
end
Report Abuse
Lem0nzzx is not online. Lem0nzzx
Joined: 08 Feb 2016
Total Posts: 1604
29 Jun 2016 06:00 AM
i = 0
for _,player in pairs(game.Players:GetPlayers()) do
i = i + 0.3
player.Character.Torso.CFrame = CFrame.new(0 + i, 75 + i, 0)
end


Report Abuse
Crazy_Coconut13 is not online. Crazy_Coconut13
Joined: 19 Jun 2016
Total Posts: 7
29 Jun 2016 06:07 AM
IT WORKED! Thank you everyone who helped!
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