This is my teleport script, that I also want to reserve the game. If i'm doing anything wrong, please tell me. I cant figure out whats wrong. Could It be me trying to see if the bool values name is the text of a text label? A bunch of the lines are just for my game, the bottom is the teleporting part
local remote = game.ReplicatedStorage.StartEvent
remote.OnServerEvent:Connect(function()
for i, v in pairs(game.Players:GetPlayers()) do
local bool = v:FindFirstChildOfClass("BoolValue")
local frame = v.PlayerGui.ActiveLobbys.Frame.Frame.Frame
local player = frame.PlayerName.Text
local gameplaceid = 3313994275
if bool then
if bool.Name == player then
if frame.Difficulty.Text == "Medium" then
gameplaceid = 3313994275
elseif frame.Difficulty.Text == "Hard" then
gameplaceid = 3313994275
end
--end
local TeleportService = game:GetService("TeleportService")
local Reserve = TeleportService:ReserveServer(gameplaceid)
--local Players = game.Players:GetPlayers() --// Returns an array of all Players
TeleportService:TeleportToPrivateServer(gameplaceid, Reserve)--, Players)
end
end
end
end)
