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

How to Teleporting between Places in the Same Game?

Asked by
tamor46 12
4 years ago
Edited 4 years ago

I am working on a game that I am considering using multiple places instead of keeping things in one place i have a problem in teleporting players to a different places in the game, I used TeleportService in my script and it worked but the problem that it teleport the player to a place that is not in the same server so if two players ether if they are friends or not teleported to the second place they will not meet each other in the place that they teleported to, because Roblox will try to fill all the servers so the players will be separated, i saw that in many games where the players in same game can follow each others through the portal that leads to another place and they will stay in the same server and if they go back where they were they will see the same players they was with.

i don't if the script help but i will put it anyway :

local TeleportService = game:GetService("TeleportService")

local placeID_1 = 4092151605

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)

2 answers

Log in to vote
0
Answered by
Farsalis 369 Moderation Voter
4 years ago
Edited 4 years ago

What I think your trying to do is, teleport the player to somewhere else in your game, and Not teleport the player to a different level. What your doing right now is to tp a player to a different game. Hooking into the event differently might help.

Edited Code:

local TeleportService = game:GetService("TeleportService")
local Place = 3137936084

script.Parent.Touched:connect(function(hit)
    local player = game.Players:GetPlayerFromCharacter(hit.Parent)
    if player then
        TeleportService:Teleport(Place, player)
    end
end)

0
no i dont mean place as a posion i meant by place is a new palace in roblox , i created new places in game explorer under places , just read the question why would i ask for that tamor46 12 — 4y
0
Sorry, what you asked before just wasnt very clear. Farsalis 369 — 4y
0
Yea lol Vortex_Vasne 89 — 4y
0
you said How to Teleporting between Places in the Same Game? i thought you meant tp to a place that is IN the Same game Vortex_Vasne 89 — 4y
0
xD Farsalis 369 — 4y
Ad
Log in to vote
0
Answered by 4 years ago

Make a part copy the position of the part

put this script in part

function onTouched(hit)  
  local human = hit.Parent:findFirstChild("HumanoidRootPart")
  brick = script.Parent
  if (human ~=nil) then
    human.CFrame= CFrame.new(Vector3.new(POSITIONHERE!)) 
   end
end

script.Parent.Touched:connect(onTouched)
0
why people wont understand me i cant explane more im not trying to change the posion of the player, i meant by place is a game that i created under game explorer not an cframe posion tamor46 12 — 4y

Answer this question