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!
To teleport a player to a Reserved server -
What is the issue? Include screenshots / videos if possible!
Whenever I load into game on roblox, I get this error:
Unable to Cast String to int64
But whenever Im in studio, I get HTTP 403 (Forbidden)
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I’ve tried Enabling HTTP requests, I’ve also tried to use a pcall but nothing has worked
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 event = game:GetService("ReplicatedStorage"):WaitForChild("Teleport")
local teleportService = game:GetService("TeleportService")
local placeId = nil
local players = game:GetService("Players")
local player = players:GetPlayers()[1]
event.OnServerEvent:Connect(function(player, chapterNumber)
if chapterNumber == 1 then
placeId = 15384706941
local reservedserver = teleportService:ReserveServer(placeId) --This gives the player a reserved server to go to
teleportService:TeleportAsync(reservedserver, {player})
end
end)
It was working fine when teleporting to a regular server, but all of a sudden its decided to mess up now.
P.S: The chapter number is sent through the remote event from the client, I’m making a horror game and Im using an integer to determine which place to teleport to.
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.