gum444
|
  |
| Joined: 06 May 2011 |
| Total Posts: 549 |
|
|
| 25 May 2016 11:40 PM |
So I took this script from the wiki and combined it with another script of mine, but when I try to set the code, it says it wont let me teleport there for some reason...
local TS = game:GetService("TeleportService") local Players = game:GetService("Players") local code = TS:ReserveServer(game.PlaceId) -- Returns a code local players = Players:GetPlayers() -- Get a list of all players TS:TeleportToPrivateServer(game.PlaceId,code,players) -- Actually teleport the players -- You could add extra arguments to this function: spawnName, teleportData and customLoadingScreen
where it says game.PlaceId, under code is where i'm trying to fix it. I can't set it to anything else beside game.PlaceId, because when I tried setting it to my actual game place id, it wont let me do it... |
|
|
| Report Abuse |
|
|
gum444
|
  |
| Joined: 06 May 2011 |
| Total Posts: 549 |
|
|
| 25 May 2016 11:42 PM |
| Perhaps the reason is because it is reserving a server? I want it to create a server, so maybe using ReserverServer would not be the proper code to use. |
|
|
| Report Abuse |
|
|
Casterlys
|
  |
| Joined: 06 Mar 2016 |
| Total Posts: 59 |
|
|
| 25 May 2016 11:42 PM |
| Have you added a place Id value? |
|
|
| Report Abuse |
|
|
gum444
|
  |
| Joined: 06 May 2011 |
| Total Posts: 549 |
|
|
| 25 May 2016 11:45 PM |
| What do you mean? Like a game for it to teleport to? If so yes |
|
|
| Report Abuse |
|
|
gum444
|
  |
| Joined: 06 May 2011 |
| Total Posts: 549 |
|
|
| 25 May 2016 11:46 PM |
Testing this code now:
local TS = game:GetService("TeleportService") local Players = game:GetService("Players") local level1Id = 415681940 local players = Players:GetPlayers() -- Get a list of all players TS:Teleport(level1Id,players) -- Actually teleport the players -- You could add extra arguments to this function: spawnName, teleportData and customLoadingScreen |
|
|
| Report Abuse |
|
|
gum444
|
  |
| Joined: 06 May 2011 |
| Total Posts: 549 |
|
| |
|
|
| 25 May 2016 11:51 PM |
It depends what you intended to do.
Are you just making a player travel?
Or
Are you generating a place and making a player teleport to it? |
|
|
| Report Abuse |
|
|
gum444
|
  |
| Joined: 06 May 2011 |
| Total Posts: 549 |
|
| |
|
gum444
|
  |
| Joined: 06 May 2011 |
| Total Posts: 549 |
|
|
| 25 May 2016 11:54 PM |
Ok so I got it to work, but the question is, can people join this server? Because I only want a few people on the server at a time (4 or more people required to start the game) And I don't want random people joining when the game is running. So maybe making it a private server is a good idea instead |
|
|
| Report Abuse |
|
|
gum444
|
  |
| Joined: 06 May 2011 |
| Total Posts: 549 |
|
|
| 25 May 2016 11:58 PM |
Would this create a private server?
local TeleportService = game:GetService("TeleportService") local level1Id = 415681940 local code = TeleportService:ReserverServer(level1Id) TeleportService:TeleportToPrivateServer(code,player) |
|
|
| Report Abuse |
|
|
gum444
|
  |
| Joined: 06 May 2011 |
| Total Posts: 549 |
|
|
| 26 May 2016 12:00 AM |
| cmon guys I could be playing csgo but instead im coding |
|
|
| Report Abuse |
|
|
gum444
|
  |
| Joined: 06 May 2011 |
| Total Posts: 549 |
|
|
| 26 May 2016 12:17 AM |
Got this code up instead, but I get a weird error, and it doesnt even look like its from the code, maybe something else.
it said http/1.1 301 moved permanently |
|
|
| Report Abuse |
|
|
gum444
|
  |
| Joined: 06 May 2011 |
| Total Posts: 549 |
|
|
| 26 May 2016 12:25 AM |
oops forgot the code
local TS = game:GetService("TeleportService") print("got ts") local Players = game:GetService("Players") print("got players") local code = TS:ReserveServer(415681940) print("got code") local players = Players:GetPlayers() print("players get players") TeleportService:TeleportToPrivateServer(game.PlaceIdcode,players) print("teleporting")
btw, code is not the game ID but the Id of the game I want the server to teleport the players to |
|
|
| Report Abuse |
|
|
gum444
|
  |
| Joined: 06 May 2011 |
| Total Posts: 549 |
|
|
| 26 May 2016 12:32 AM |
I DID IT OMG YES
local TS = game:GetService("TeleportService") print("got ts") local Players = game:GetService("Players") print("got players") local code = TS:ReserveServer(415681940) print("got code") local players = Players:GetPlayers() print("players get players") TeleportService:TeleportToPrivateServer( 415681940, code, players ) |
|
|
| Report Abuse |
|
|