Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Reserved Servers - Invalid access code?

Asked by
sheepposu 561 Moderation Voter
5 years ago

I have this code for my game, it wont' work though because I am using invalid access code, what can I do to get a valid access code.

local DSS = game:GetService("DataStoreService")
local DS = DSS:GetGlobalDataStore()
local code = DS:GetAsync("ReservedServer")
local TpS = game:GetService('TeleportService')


game.ReplicatedStorage.Teleport.OnServerEvent:Connect(function(plr, Place, saves)
    code = TpS:ReserveServer(game.PlaceId)
    DS:SetAsync("ReservedServer",code)
    TpS:TeleportToPrivateServer(Place, code, {plr}, '', saves)
end)
0
What is passed into the Place parameter? If you're trying to teleport someone to 'Place', but you are reserving a server for the current place (line 8), 'code' will be an access code for another place, therefor making it invalid. Could this be your problem? pidgey 548 — 5y
0
Thankyou, I changed game.PlaceId to Place sheepposu 561 — 5y

Answer this question