Hello all, so i will explain the problem and how the game should work:
So we have Starter Place, Place A and Place B.
How it works is that from Starter Place, using some teleport gates, players get into groups and go to a Reserved Instance in Place A. Then from place A they can go to B.
Issue:
Players when going from Place A to Place B, appear in a “public” place B instance. In other words, groups from different Reserved Place A instances, meet each other when they go to Place B.
What i want:
I want players from Place A, to stick with their own group into a Reserved Instance for Place B but not necessarily have them ALL teleport at the same time, just teleport each player as he touches the trigger part. Ive looked the resources online and adjusted my script but cant seem to make it work as i want to. With my adjusted script, players from Place A are getting teleported into individual Place B instances, but they are not going to the same server. Any help? This is the code:
local TeleportService = game:GetService("TeleportService")
local Players = game:GetService("Players")
local TeleportLocation = 7368375586
script.Parent.Touched:Connect(function(otherPart)
if otherPart.Parent:FindFirstChildWhichIsA("Humanoid") then
local player = Players:GetPlayerFromCharacter(otherPart.Parent)
local code = TeleportService:ReserveServer(TeleportLocation)
TeleportService:TeleportToPrivateServer(TeleportLocation, code,{player})
end
end)