I want to shorten a code for a reserved server (like aba, liberty county, shinobi life etc did) and then have a player type the code in chat so they could join the server
Is there any way to shorten the codes? I couldn’t find the solution anywhere on the dev forum but I did find others with the same problem
This is an example of what the codes look like but I want to be able to shorten them
local TS = game:GetService("TeleportService")
local DataStoreService = game:GetService("DataStoreService")
local ReservedServerDataStore = DataStoreService:GetDataStore("ReservedServerDataStore")
local reservedCode = TS:ReserveServer(game.PlaceId)
local Data = ReservedServerDataStore:GetAsync(game.GameId) or {}
local updateData = table.insert(Data, reservedCode)
ReservedServerDataStore:SetAsync(game.GameId, Data)
local function playerAdded(player)
player.Chatted:Connect(function(message)
for _, Code in pairs(ReservedServerDataStore:GetAsync(game.GameId)) do
if message == tostring(Code) then
TS:TeleportToPrivateServer(game.PlaceId, Code, {player})
end
end
end)
end
game.Players.PlayerAdded:Connect(function(player)
playerAdded(player)
end)