It seems like what you are trying to do is reserve a server, then update the datastore of Server1 to be value of the server’s access code. In that case, you could call TeleportService:ReserveServer outside of the async function, hold the result in a local variable, then just return that local variable value inside UpdateAsync. Ideally this would all be contained in its own function so that the access code doesn’t leave its scope. It would look something like the following:
local DataStoreService = game:GetService("DataStoreService")
local MyServersStore = DataStoreService:GetDataStore("MyServers")
local TeleportService = game:GetService("TeleportService")
function saveKeyAndUpdateStore()
local reserveCode = TeleportService:ReserveServer(7013735989)
MyServersStore:UpdateAsync('Server1', function()
return reserveCode
end)
end
saveKeyAndUpdateStore()