I tried tonumber() an already number. Didn't work
Server Script
01 | repeat wait() until game.Workspace |
02 |
03 | local TeleportService = game:GetService( "TeleportService" ) |
04 |
05 | local Remote = script.Parent.Event |
06 |
07 | Remote.OnServerEvent:Connect( function (SentFrom, Setting, ExtraData) |
08 | if string.lower(Setting) = = "teleport" then |
09 | local finished, err = pcall ( function () |
10 | local Code = TeleportService:ReserveServer(ExtraData) |
11 | TeleportService:TeleportToPrivateServer( 4805466213 , Code, { SentFrom } ) |
12 | end ) |
13 |
14 | if not finished then |
15 | warn(err) |
16 | end |
17 | end |
18 | end ) |
Local Script
01 | function GenCode(Len, Al, Num, Special, Space) |
02 |
03 | local Len_Code = Len |
04 |
05 | local Alphabet = Al |
06 | local Numbers = Num |
07 | local SpecialCharacters = Special |
08 | local Space = Space |
09 |
10 | local alphabet = 'AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz' |
11 | local numbers = '1234567890' |
12 | local specialcharacters = '{}!@#$%^&*()_+-=[]\\/.,*+' |
13 | local space = ' ' |
14 | local output = '' |
15 |
The function TeleportService:ReserveServer
takes 1 argument. That argument is the place id of the place you want to reserve a server at.. the function returns a code, this code is passed to TeleportService:TeleportToPrivateServer
as the second argument.. The argument list of TeleportService:TeleportToPrivateServer
is:
1: onces again the place Id where you reserved server
2:server code returned from ReserveServer
3: players to teleport
however, you passed a custom made(ExtraData) id to ReserveServer
, which i assume is a string..