I went in so many social medias to know how to fix my problem
-YouTube
-The Developer Forum
-Reddit
-The Roblox Engine API
I’ve never found a solution.
My ServerScript with the error
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local MessagingService = game:GetService("MessagingService")
local TeleportService = game:GetService("TeleportService")
local Debris = game:GetService("Debris")
local Players = game:GetService("ReplicatedStorage"):WaitForChild("Players")
local ReadyEvent = ReplicatedStorage:WaitForChild("Ready")
local UnreadyEvent = ReplicatedStorage:WaitForChild("Unready")
local Room = {}
game.Players.PlayerAdded:Connect(function(Player)
ReadyEvent.OnServerEvent:Connect(function(Plr)
MessagingService:PublishAsync("Ready", "Ready")
end)
UnreadyEvent.OnServerEvent:Connect(function(Plr)
MessagingService:PublishAsync("Unready", "Unready")
end)
MessagingService:SubscribeAsync("Ready", function(value)
if Players:FindFirstChild(Player.Name) == nil then
local PlayerValue = Instance.new("ObjectValue")
PlayerValue.Value = Player
PlayerValue.Name = Player.Name
PlayerValue.Parent = Players
task.wait()
MessagingService:PublishAsync("NumberOfPlayers", #Players:GetChildren())
end
end)
MessagingService:SubscribeAsync("Unready", function(value)
local ifPlayerFound = Players:FindFirstChild(Player.Name)
if ifPlayerFound then
Debris:AddItem(ifPlayerFound, 0)
task.wait(0.1)
MessagingService:PublishAsync("NumberOfPlayers", #Players:GetChildren())
end
end)
MessagingService:SubscribeAsync("NumberOfPlayers", function(number)
if number.Data == 1 then
Player.PlayerGui.ScreenGui.TextLabel.Text = "1 player is ready"
else
Player.PlayerGui.ScreenGui.TextLabel.Text = number.Data.." players are ready"
end
end)
print(#Players:GetChildren())
while task.wait(10) do
for i, v in pairs(Players:GetChildren()) do
table.insert(Room, v.Value)
end
local success, err = pcall(function()
TeleportService:TeleportAsync(4972532928, Room, Enum.TeleportType.ToReservedServer)
end)
table.clear(Room)
if not success then
warn(err)
end
end
end)
Hello maybe the problem is with object does object have codes if yes then i guess you made a mistake on code (im not good at code things but i hope this can help out) and i do have teleporting system for my game maybe you can checkout
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerScriptService = game:GetService("ServerScriptService")
local TeleportService = game:GetService("TeleportService")
local SafeTeleport = require(ServerScriptService.SafeTeleport)
local movingEvent = ReplicatedStorage:WaitForChild("MovingElevator")
local elevatorEvent = ReplicatedStorage:WaitForChild("Elevator")
local elevator = script.Parent
local prismatic = elevator.Shaft.PrismaticConstraint
local gui = elevator.Screen.Attachment.TimeGui
local mapgui = elevator.Screen.MapGui.ProgressBar
local config = elevator.Config
local playersWaiting = {}
local countdownRunning = false
local moving = false
local function Setup()
playersWaiting = {}
moving = false
mapgui.Title.Text = #playersWaiting .. "/" .. config.MaxPlayers.Value
gui.Status.Text = "Players Needed"
end
local function TeleportPlayers()
local placeId = 14361189698
local server = TeleportService:ReserveServer(placeId)
local options = Instance.new("TeleportOptions")
options.ReservedServerAccessCode = server
SafeTeleport(placeId, playersWaiting, options)
print("Finished Teleport")
end
local function MoveElevator()
moving = true
for i, player in pairs(playersWaiting) do
movingEvent:FireClient(player)
end
gui.Status.Text = "Teleporting Players..."
prismatic.TargetPosition = -20
TeleportPlayers()
task.wait(10)
prismatic.TargetPosition = 0
task.wait(8)
Setup()
end
local function RunCountdown()
countdownRunning = true
for i=15, 1, -1 do
gui.Status.Text = "Starting: " .. i
task.wait(1)
if #playersWaiting < 1 then
countdownRunning = false
Setup()
return
end
end
MoveElevator()
countdownRunning = false
end
elevator.Entrance.Touched:Connect(function(part)
local player = Players:GetPlayerFromCharacter(part.Parent)
local isWaiting = table.find(playersWaiting, player)
if player and not isWaiting and #playersWaiting < config.MaxPlayers.Value and not moving then
table.insert(playersWaiting, player)
mapgui.Title.Text = #playersWaiting .. "/" .. config.MaxPlayers.Value
player.Character.PrimaryPart.CFrame = elevator.TeleportIn.CFrame
elevatorEvent:FireClient(player, elevator)
if not countdownRunning then
RunCountdown()
end
end
end)
elevatorEvent.OnServerEvent:Connect(function(player)
local isWaiting = table.find(playersWaiting, player)
if isWaiting then
table.remove(playersWaiting, isWaiting)
end
mapgui.Title.Text = #playersWaiting .. "/" .. config.MaxPlayers.Value
if player.Character then
player.Character.PrimaryPart.CFrame = elevator.TeleportOut.CFrame
end
end)
i have the same problem now, this maybe problem with roblox. i can’t use reserved servers, for how long this error there? , i have 403 forbidden error for my own place that is published, soo this is 90% roblox
Go to your experience’s page on Roblox, then click Configure Place, and look at the page URL. It should be the second string of numbers, instead of the first.
Also, why are you looking through a folder called “Players” in ReplicatedStorage for your list of players to teleport? I’d recommend just using game.Players:GetChildren() for your players value (however remember to do this before you teleport your players, instead of at the start of the script).
(local Players = game:GetService("ReplicatedStorage"):WaitForChild("Players"))