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

How to teleport group of players to reserved server like the game CAMPING?

Asked by
l1u2i3 52
4 years ago
Edited 4 years ago

So there has been this game that has recently come out which is called Camping. You are teleported to another server with a group of people who have joined you on a truck. I have been wondering how this is done because I haven't been able to figure it out so far.

I've read almost every page of information on how to do it, but nothing would work for me. Does anyone have an idea of how they do it?

I have attempted this code - (This is not the only code I have attempted. I am having trouble finding the other ones.)

local TeleportService = game:GetService("TeleportService")
local DSS = game:GetService("DataStoreService")
local DS = DSS:GetGlobalDataStore()
local code = DS:GetAsync("ReserveServer")
if type(code) ~= "string" then
code = game:GetService("TeleportService"):ReserveServer("2575716765")
DS:SetAsync("ReserveServer",code)
end

for i,v in pairs(game.Teams["Team"]:GetPlayers()) do
    TeleportService :TeleportToPrivateServer(3180151090,code,v)
end
0
What's your attempt code? climethestair 1663 — 4y
0
Similar to what noammao said, this video on YouTube (https://www.youtube.com/watch?v=KgiINhZ8xGk) is a tutorial on how to make a player teleport to a different place when touching an object. Maybe if the players get in a car like in Camping, and the car drives into a wall in which will teleport the players, that would work? I actually was experimenting and I made it so you click on a GUI. benawesomeness8954 0 — 4y

1 answer

Log in to vote
0
Answered by
noammao 294 Moderation Voter
4 years ago

I don't know if this is what you are looking for but there are (at least that I know of) 3 kinds of teleport. Teleport inside a place, teleport between places & teleporting between games.

Teleporting all players inside of a place would look something like this: It's from the Roblox dev forum developer.roblox

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
   --Make sure the character exists and its HumanoidRootPart exists
   if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
       --add an offset of 5 for each character
      player.Character.HumanoidRootPart.CFrame = target + Vector3.new(0, i * 5, 0)
   end
end

Teleporting between places would look something like this: Taken from roblox dev forum developer.roblox

local TeleportService = game:GetService("TeleportService")

local placeID_1 = 408502340
local placeID_2 = 408502380

local function onPartTouch(otherPart)
    local player = game.Players:GetPlayerFromCharacter(otherPart.Parent)
    if player then
        TeleportService:Teleport(placeID_1, player)
    end
end
script.Parent.Touched:Connect(onPartTouch)

Then you can also teleport between games: Taken from this thread ScriptingHelpers You cannot access this through the studio though. And in this example, the script is inside a part in workspace.

script.Parent.Touched:Connect(function(player)
    if player.Parent:FindFirstChild("HumanoidRootPart") then
local service = game:GetService("TeleportService");
local place = 20279777; --Voidacity's Script Builder
local plr = game.Players:GetPlayerFromCharacter(player.Parent)

service:Teleport(place,plr);
end
end)
0
Also, the placeId (the number) are the numbers you see while on the games' page. For example in this link: https://www.roblox.com/games/3030960971/Camping-Simulator-Beta. The Id would be "3030960971". You can do the same for decals, accessories & animations. noammao 294 — 4y
0
Or if you are trying to access another place within your game you are able to get the id by clicking on "game explorer" in the studio. Then rightclick on the place, and click "Copy ID To Clipboard" noammao 294 — 4y
Ad

Answer this question