You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
a script that makes it so that if a player tries to join after 2 minutes of the server’s creation they will be teleported to another new server -
What is the issue? Include screenshots / videos if possible!
it says HTTP 403 (Forbidden) -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
found some posts, didn’t understand and didn’t help
local Game = game
local Players = Game:GetService("Players")
local TeleportService = Game:GetService("TeleportService")
local AccessCode = TeleportService:ReserveServer(9007382899)
local State
local function OnPlayerAdded(Player)
if not State then return end
TeleportService:TeleportToPrivateServer(9007382899, AccessCode, {Player}) --Attempt the teleport.
end
Players.PlayerAdded:Connect(OnPlayerAdded)
task.wait(120)
State = true