You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Hello! I’m DragonDarkVader, A Roblox Developer with almost 1.6 years of Building experience and currently learning coding too! I’m having trouble with
CreatePrivateServer()
and usingReservedServer()
andTeleportToPrivateServer()
. The game is currently inspired by Apeirophobia. I’m making a Lobby Gui which is like Apeirophobia!
-
What is the issue? *I’m currently having trouble on this. Well i have the script tho. Just the Create Button, Password Button (Where you can generate your password) and choices if your server is public or private! And if the Player creates a Server. It displays in the “Servers” Frame. And with the Players profile and Name in it with the Join Button. And with the text which updates everytime a player joins which is the “Queue: 0/4”
-
What solutions have you tried so far? I tried looking up in DevForum. And created a topic like this, Nobody responded to EVERY topic i created. I found a Documentation in Developer Forum (Not DevForum) and it shows everything. Just the Button which you can create a server with choices if your server is public/private and you can generate a code to it.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
THE CODE:
-- // ReserveServer() \\ --
local TeleportService = game:GetService("TeleportService")
local Players = game:GetService("Players")
local code = TeleportService:ReserveServer(game.PlaceId)
local players = Players:GetPlayers()
TeleportService:TeleportToPrivateServer(game.PlaceId, code, players)
local TeleportService = game:GetService("TeleportService")
local Players = game:GetService("Players")
local DataStoreService = game:GetService("DataStoreService")
local dataStore = DataStoreService:GetGlobalDataStore()
local code = dataStore:GetAsync("ReservedServer")
if typeof(code) ~= "string" then
code = TeleportService:ReserveServer(game.PlaceId)
dataStore:SetAsync("ReservedServer", code)
end
local function joined(player)
player.Chatted:Connect(function(message)
if message == "reserved" then
TeleportService:TeleportToPrivateServer(game.PlaceId, code, { player })
end
end)
end
Players.PlayerAdded:Connect(joined)
-- // GetArrivingTeleportGui() \\ --
local TeleportService = game:GetService("TeleportService")
local Players = game:GetService("Players")
local ReplicatedFirst = game:GetService("ReplicatedFirst")
local customLoadingScreen = TeleportService:GetArrivingTeleportGui()
if customLoadingScreen then
local playerGui = Players.LocalPlayer:WaitForChild("PlayerGui")
ReplicatedFirst:RemoveDefaultLoadingScreen()
customLoadingScreen.Parent = playerGui
task.wait(5)
customLoadingScreen:Destroy()
end
-- \\ GetTeleportSetting() \\ --
local TeleportService = game:GetService("TeleportService")
local teleportData = TeleportService:GetLocalPlayerTeleportData()
print("Local player arrived with this data:", teleportData)
-- // SetTeleportGui() \\ --
local TeleportService = game:GetService("TeleportService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TeleportScreen = ReplicatedStorage.TeleportingScreen
TeleportService:SetTeleportGui(TeleportScreen)
-- // TeleportPartyAsync() \\ --
local Players = game:GetService("Players")
local TeleportService = game:GetService("TeleportService")
local PLACE_ID = 11278087451 -- replace
local playerList = Players:GetPlayers()
local success, result = pcall(function()
return TeleportService:TeleportPartyAsync(PLACE_ID, playerList)
end)
if success then
local jobId = result
print("Players teleported to", jobId)
else
warn(result)
end
-- // Teleport() \\ --
local Players = game:GetService("Players")
local TeleportService = game:GetService("TeleportService")
local PLACE_ID = 11278087451 -- replace here
local USER_ID = 1 -- replace with player's UserId
local player = Players:GetPlayerByUserId(USER_ID)
TeleportService:Teleport(PLACE_ID, player)
local TeleportService = game:GetService("TeleportService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local playerGui = Players.LocalPlayer:WaitForChild("PlayerGui")
local PLACE_ID = 0 -- replace here
local loadingGui = ReplicatedStorage:FindFirstChild("LoadingGui")
-- parent the loading gui for this place
loadingGui.Parent = playerGui
-- set the loading gui for the destination place
TeleportService:SetTeleportGui(loadingGui)
TeleportService:Teleport(PLACE_ID)
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.
Can anybody help me? Or provide tutorials that find helpful to me?