|
| 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 |
|
|
|
| 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 |
|
|
|
| 28 Jun 2016 11:52 PM |
| Alright, thanks for the help! |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
| |
|
|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 29 Jun 2016 06:07 AM |
| IT WORKED! Thank you everyone who helped! |
|
|
| Report Abuse |
|
|