Is it possible to create system like to join server which isn’t full and in which game not started yet?
And should i use HttpService for it?
Now i stopped on this code:
Local Script:
local Event = game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvents"):WaitForChild("AddPlayerToThisServer")
local function Mouse1Click()
Event:FireServer()
end
script.Parent.MouseButton1Click:Connect(Mouse1Click)
Server Script:
local TPS = game:GetService("TeleportService")
local RS = game:GetService("ReplicatedStorage")
local RemoteEvents = RS:WaitForChild("RemoteEvents")
local RemoteEvent = RemoteEvents:WaitForChild("AddPlayerToThisServer")
local PlaceId = 14616677870
local Players = {}
local function TeleportPlayers()
if Players[1] ~= nil then
local Server = TPS:ReserveServer(PlaceId)
local TeleportOptions = Instance.new("TeleportOptions")
TeleportOptions.ReservedServerAccessCode = Server
TPS:TeleportAsync(PlaceId,Players,TeleportOptions)
end
end
RemoteEvent.OnServerEvent:Connect(TeleportPlayers)