--Service
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local players = game:GetService("Players")
local ServScriptService = game:GetService("ServerScriptService")
--variables
local requiredPlayers = 1
local roundLength = 10
local intermissionLength = 10
local lobby = workspace.Lobby
local kameha = ServScriptService.Kameha
local statusText = ""
local statusUpdate = ReplicatedStorage.Remotes:WaitForChild("StatusUpdate")
local function waitForPlayers()
statusText = "Waiting for players..."
repeat
task.wait(.5)
statusUpdate:FireAllClients(statusText)
until #players:GetPlayers() >= requiredPlayers
end
local function startRound()
end
local function endRound()
end
while true do
-- intermission
for i = intermissionLength, 0, -1 do
statusText = "Waiting for next round... ("..tostring(i)..")"
statusUpdate:FireAllClients(statusText)
task.wait(1)
end
waitForPlayers()
startRound()
for i = roundLength, 0 , -1 do
statusText = "Game running...("..tostring(i)..")"
statusUpdate:FireAllClients(statusText)
task.wait(1)
end
endRound()
end
I need that when the round ends the players teleported to the lobby, I can not understand how to do this because to local players and then to humanoidrootpart I can not access. I need you to help me teleport players to the lobby.