I am trying to make a teleport service teleport everyone to the same server.
When I start the game it says 403(Forbidden) in Studios
In the game itself it says
I made both games Public, enabled all Security settings, looked it up on DevForum(There solution was making it public)
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
local Players = game:GetService("Players")
local RSC = game:GetService('TeleportService'):ReserveServer(7807534521)
local part = script.Parent
local function onTouched(part)
local player = Players:GetPlayerFromCharacter(part.Parent)
if not player then return end
game:GetService('TeleportService'):TeleportToPrivateServer(7807534521, RSC, player)
end
part.Touched:Connect(onTouched)
You have clearly done something wrong. Are you trying to teleport players to a separate game owned by another player? If it isn’t directly owned by you (group ownership or account ownership) then you won’t be able to reserve a server for the game.
You are not able to reserve private servers for a game that the script is not based within. You should try teleporting the player to a public server of the other game, but pass an argument with that teleport so when the player reaches the new game then you have a receiving script to detect that argument and send him to a private server.
Also I suggest using TeleportAsync. Heres a code example:
local tps = game:GetService("TeleportService")
local teleportOptions = Instance.new("TeleportOptions")
teleportOptions.ShouldReserveServer = true
local teleportWorks, teleportNoWorks = pcall(function()
tps:TeleportAsync(yourPlaceId, {player}, teleportOptions)
end)
if teleportWorks then
return true
else
error(teleportNoWorks)
end