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

Currently trying to learn ReserveServers and HTTP 403 Error in the output. How to fix?

Asked by 4 years ago

Currently trying to learn ReserveServers and keep getting the HTTP 403 Error in the output. How to fix?

local TS = game:GetService("TeleportService")
local Players = game:GetService("Players")
local DSS = game:GetService("DataStoreService")
local DS = DSS:GetGlobalDataStore()

-- Get the saved code
local code = DS:GetAsync("ReservedServer")
if type(code) ~= "string" then -- None saved, create one
    code = TS:ReserveServer(game.PlaceId)
    DS:SetAsync("ReservedServer",code)
end

local function Joined(plr)
    -- Everytime they chat, we want to know
    plr.Chatted:Connect(function(msg)
        if msg == "reserved" then -- Aha, that's our cue
            TS:TeleportToPrivateServer(game.PlaceId,code,{plr})
        end
    end)
end

-- Connect all current and future players
Players.PlayerAdded:Connect(Joined)
for k,v in pairs(Players:GetPlayers()) do
    Joined(v)
end
0
From roblox wiki btw JackThePro202 -2 — 4y
0
the reserve server thing doesn't work in the Roblox Studion. TheRealPotatoChips 793 — 4y
0
Studio* TheRealPotatoChips 793 — 4y

1 answer

Log in to vote
1
Answered by 4 years ago

As TheRealPotatoChips said, you can't use TeleportService in Studio.

Also, have you enabled 'Allow HTTP Requests' in your game? If not, you can do this by clicking Settings in Studio, then going to Options, and checking off the box that says 'Yes' beside 'Allow HTTP Requests' and this should work in live servers.

Hope this helped!

Ad

Answer this question