I tried tonumber() an already number. Didn't work
Server Script
repeat wait() until game.Workspace
local TeleportService = game:GetService("TeleportService")
local Remote = script.Parent.Event
Remote.OnServerEvent:Connect(function(SentFrom, Setting, ExtraData)
if string.lower(Setting) == "teleport" then
local finished, err = pcall(function()
local Code = TeleportService:ReserveServer(ExtraData)
TeleportService:TeleportToPrivateServer(4805466213, Code, {SentFrom})
end)
if not finished then
warn(err)
end
end
end)
Local Script
function GenCode(Len, Al, Num, Special, Space)
local Len_Code = Len
local Alphabet = Al
local Numbers = Num
local SpecialCharacters = Special
local Space = Space
local alphabet = 'AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz'
local numbers = '1234567890'
local specialcharacters = '{}!@#$%^&*()_+-=[]\\/.,*+'
local space = ' '
local output = ''
local function ReturnUsable()
local returntable = {}
if Alphabet == true then
table.insert(returntable,1,alphabet)
end
if Numbers == true then
table.insert(returntable,1,numbers)
end
if SpecialCharacters == true then
table.insert(returntable,1,specialcharacters)
end
if Space == true then
table.insert(returntable,1,space)
end
return returntable
end
for i = 1, Len_Code do
local tables = ReturnUsable()
local CurrentType = tables[math.random(1,#tables)]
local a = math.random(1,string.len(CurrentType))
output = output..string.sub(CurrentType,a,a)
end
return output
end
function CreateCode()
return GenCode(6, true, true, false, false)
end
function CreateGame()
local Code = CreateCode()
Remote:FireServer("Teleport", Code)
end
CreateBtn.MouseButton1Click:Connect(CreateGame)

10 comments
can we see the functions
GenCode?You can't use the placeID / gameID to teleport to a ReservedServer, use the reserved server code
all it does is generate a random code with letters and numbers and is returned as a string
Brad, can we see the function GenCode?
Ok now
NVM, can you just tell me what the function is suppose to do and return?
It generates a random string that has the length of 6 as the private server code.
You cannot reserve a server to an invalid PlaceId
ohh i see the problem
lemme write an answer