My current is is that for some reason the reserve server in my game is not being called.
-
The code in my game has been thoroughly tested and has worked many many times before.
-
No changes have recently been made to the script that has made it not work.
-
Usually in Roblox Studio or in Roblox Player it will show that it’s called it, in Studio this is shown saying it can’t be called in Studio, in Roblox Player it just teleports the player.
There is the possibility I closed Roblox Studio without saving it or the Auto Save canceled, I am not sure, I am also open to the fact I did edit something and made that mistake and just overlooked it in memory.
Code:
--Variables and code for reserve server stuff
local MainMusic = game.SoundService["Distorted Reality Perception - Leon Riskin"]
local reserve = game.StarterGui.ScreenGui.PlayFrame.GameTypeButton1
local debounce = false
local ScreenGui = game.StarterGui.ScreenGui
reserve.MouseButton1Click:Connect(function()
print("starting reserve")
if debounce then return end
debounce = true
local ts = game:GetService("TeleportService")
local access = ts:ReserveServer(game.PlaceId)
ts:TeleportToPrivateServer(game.PlaceId, access, game.Players:GetPlayers())
warn("Teleporting everybody...")
task.wait(5)
debounce = false
end)
local Players = game:GetService("Players")
local player = script:FindFirstAncestorOfClass("Player")
local Camera = workspace.CurrentCamera
local Players = game:GetService("Players")
local isReserved = game.PrivateServerId ~= "" and game.PrivateServerOwnerId == 0
if isReserved == true then
print("reserved is true")
ScreenGui.Enabled = false
Camera.CameraType = Enum.CameraType.Custom
MainMusic.Playing = false
end
It is a Script in StartGui. The ScreenGui is completely separate.