Hello, I currently trying to make a round based system for my upcoming game “My Opinion”.
Right now, I am trying to make it so it teleports only one random person every round to the MapSpawn. But for some reason whenever I play test it, It never actually teleports me to the MapSpawn which is weird because I am the only player in the game. Additionally, I am not getting anything from the output window to tell me what’s wrong with the code. Really hope someone can help me on this ![]()
local intermission = 15
local roundLength = 60
local inRound = game.ReplicatedStorage.InRound
local status = game.ReplicatedStorage.Status
inRound.Changed:Connect(function()
if inRound.Value == true then
for i, plr in pairs(game.Players:GetPlayers(Random)) do
local char = plr.Character
if char and char:FindFirstChild("HumanoidRootPart") then
local humanRoot = char.HumanoidRootPart
humanRoot.CFrame = game.Workspace.Spawns.MapSpawn.CFrame
end
for i, plr in pairs(game.Players:GetPlayers()) do
local char = plr.Character
if char and char:FindFirstChild("HumanoidRootPart") then
local humanRoot = char.HumanoidRootPart
humanRoot.CFrame = game.Workspace.Spawns.LobbySpawn.CFrame
end
end
end
else
for i, plr in pairs(game.Players:GetPlayers()) do
local char = plr.Character
if char and char:FindFirstChild("HumanoidRootPart") then
local humanRoot = char.HumanoidRootPart
humanRoot.CFrame = game.Workspace.Spawns.LobbySpawn.CFrame
end
end
end
end)
local function round()
while true do
inRound.Value = false
for i = intermission, 0, -1 do
status.Value = "Round will start in " .. i .. " seconds"
wait(1)
end
inRound.Value = true
for i = roundLength, 0, -1 do
status.Value = "Round will end in " .. i .. " seconds"
wait(1)
end
end
end
spawn(round)
I am also trying to make it to whenever there is intermission, It teleports all players back to the lobby, until the next round begins and chooses another random player. But i am fairly certain that part of the code is fine.
