Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to use reserved servers?

Asked by
hokyboy 270 Moderation Voter
4 years ago

i wanted to make a zombie game like BOII but if i use the normal teleport service players can join mid round AND that would be bad i read some articles about it but i still dont quit understand can someone help me?

0
yeah i need to know this too KingIce1310 23 — 4y

1 answer

Log in to vote
1
Answered by
bnxDJ 57
4 years ago
Edited 4 years ago

In your case you would probably use a different place other than the game that teleports the players. If you didn't know that place should be apart of the game. In case you don't know what I mean then read this article: https://developer.roblox.com/en-us/articles/games-and-places

Example script:

local TS = game:GetService("TeleportService")
local Players = game:GetService("Players") --You could just use a different table which has only select players in it but this is only an example.

local PlaceId = game.PlaceId--The place id of the place you want to teleport players to.

local code = TS:ReserveServer(PlaceId) -- This is the code you would use to teleport to the server. Here it reserves a server on the same game not a different place.

TS:TeleportToPrivateServer(PlaceId,code,players)

--TS:TeleportToPrivateServer(ID of place with reserved server,code which is used to find that server,array of players that should be teleported to the server) 
0
and no other players will be able to join this? hokyboy 270 — 4y
0
wait i got a question, for local PlaceId, do i just put it as game.5002451166 (my place that i want to be teleported to) KingIce1310 23 — 4y
0
PlaceId isn't a placeholder for the actual PlaceId but it's getting the PlaceId from the current game. Other way you would just change it to the ID and nothing else. And yes they would only be able to join if the server teleported them using that code. bnxDJ 57 — 4y
0
oh but i need them to be teleported into another place in the game, so what should i put? KingIce1310 23 — 4y
View all comments (2 more)
0
you should make it local PlaceId = 149023933 (example ID) bnxDJ 57 — 4y
0
aight also where should i put the script and what kind of script should i put the code in. KingIce1310 23 — 4y
Ad

Answer this question