So my game start fine, with intermission time, and it fails when its time to tp players to a random map and then give players guns, that i have on server storage, the script just ignores the WHOLE BLOCK of Map,Teleporting and giving players code, so what's the problem with my script? it jumps from intermission to Round without even loading the map, so i guess something bad i am doing. Please, help me. if u have doubt about killing the players, is because i want them to respawn in their respective team spawn.
FUNCTIONS
Status.Changed:Connect(function()
game.ReplicatedStorage.TimerEvent:FireAllClients()
end)
local function ChoosenMap()
local randomizer = Maps[math.random(1,#Maps)]:Clone()
randomizer.Parent = game.Workspace
end
local givePlayers = coroutine.wrap(function()
local players = game.Players:GetChildren()
local tommyGun = serverStorage:FindFirstChild("Tommy Gun")
if tommyGun then
local tool = tommyGun:Clone()
tool.Parent = players.Backpack
end
end)
"WHILE TRUE DO" CODE
while true do
repeat
Status.Value = "Need 2 players to start! "
wait(1)
until #game.Players:GetPlayers() >= 0
for i = intermission,0,-1 do
Status.Value = "intermission: " .. i
wait(1)
print("loop 1 sucess")
end
inRound.Value = true
wait(3)
local players = game.Players:GetPlayers()
if inRound == true then
for i, v in pairs(game.Workspace.Lobby.LobbySpawns:GetChildren())do
v.Enabled = false
end
ChoosenMap()
wait(7)
for i, plr in pairs(game.Players:GetChildren())do
if plr.Character:FindFirstChild("Humanoid") then
plr.Character.Humanoid.Health:TakeDamage(100)
end
end
givePlayers()
end
print("getting on round code block.")
for i = 120, 0, -1 do
Status.Value = "Round: " .. i
wait(1)
end
if inRound == false then
local lobbysP = game.Workspace.Lobby.LobbySpawns:GetChildren()
lobbysP.Enabled = true
ChoosenMap():Destroy()
players.Backpack:ClearAllChildren()
players.Character:FindFirstChild("Humanoid"):TakeDamage(100)
end
end

1 comment
I guess you forgot to put "inRound.Value" on line 21