So there is a thing called Reserved Places. I want to do something with them.
Basically I want to create a reserved place and store it in a data store under a certain key, I then want to be able to make it so if someone enters said key into a textbox it then sends them to the reserved place, how can I do this?
Note i have the datastore part down I just need to figure out the reserved places part cause no matter what I tried I couldnt figure it out
To make a new ReservedPlace, use :ReserveServer. It returns the ReservedServerAccessCode you’ll need to join the server. You could save this ReservedServerAccessCode under your key.
Code example:
local TeleportService = game:GetService("TeleportService")
local teleportPlaceId = 123456789
local code = TeleportService:ReserveServer(teleportPlaceId)
local teleportOptions = Instance.new("TeleportOptions")
teleportOptions.ReservedServerAccessCode = code
TeleportService:TeleportAsync(teleportPlaceId, {Player1, Player2}, teleportOptions)```
Ok so yay I can generate the server but I need to be able to save it to a Datastore, tried doing it how one might assume,
local success,err = pcall(function()
local code = GenerateLobbyCode()
if not lobbys:GetAsync(code) then
server.Place = teleportService:ReserveServer(LobbyId)
lobbys:SetAsync(code,server) -- save it!
end
end)
But it always says I cant save Dictionaries which you very much can and I have done before so I am assuming it has to do with setting the server.place value to well the reserved server, is there any other way to store it so I can send others there?
Yes, but it’s unsecured as retrieves the data on the client meaning exploiters can manipulate the data.
You should only be using SetTeleportData to transmit data for use on client.
Any senstive data/data that should be secured for use on server should be Stored in a Memory Store or a Data Store
Have you tried using HttpService:JSONEncode?
You should be able to store dictionaries in Datastores, could you please tell me the error message you get while doing it?
I’m pretty sure that the reserved server counts as an instance so is there anyway I can access said reserved server with something else like a code or something?
which in my code from earlier you can see that I set server.Place to the reserved server, considering the reserved server is probably an instance of some form that is probably why it isnt saving, correct me if i’m wrong though.
Just figured out I was storing the player, changed it to just there name Ima see if it works