I am making a round-based game and have been stuck for days. t all works find up until line 31 when it tries to find the bool value loaded inside the players backpack. It gives no error but skips over the if statement and it can't find the boolvalue even though I checked the players backpack during runtime with the value being in the backpack. I have tried everything such as wait for child andmany other slutions people gave out but NOTHING WORKS!
local status = game:GetService("ReplicatedStorage").Status
local games = game:GetService("ServerStorage").Games:GetChildren()
local lobbyMusic = workspace.Music.LobbyMusic
local gameMusic30 = workspace.Music.GameMusic30
local gameMusic60 = workspace.Music.GameMusic60
local countEffect = workspace.Music.CountEffect
while true do
wait(1)
i = 10
while i ~= -1 do
wait(1)
status.Value = "Intermission: "..i
i = i - 1
end
status.Value = "Selecting Game"
wait(5)
local rand = math.random(1,#games)
local chosenGame = games[rand]
local clone = chosenGame:Clone()
clone.Parent = workspace
status.Value = "Game Chosen: "..games[rand].Name
wait(3)
status.Value = "Teleporting"
wait(2)
status.Value = "Game In Progress"
local points = clone.SpawnPoints:GetChildren()
for i,v in pairs(game:GetService("Players"):GetChildren()) do
local char = v.Character
local rand = math.random(1,#points)
if v.Backpack:FindFirstChild("Loaded")then
char.HumanoidRootPart.CFrame = points[rand].CFrame
moduleMain = require(chosenGame.MainScript)
v.Backpack.InGame.Value = true
end
end
for i = 5,0,-1 do
wait(1)
status.Value = "Game In Starting: "..i
end
wait()
for i = chosenGame.GameTime.Value, 1,-1 do
wait(1)
status.Value = "Game In Progress: "..i - 1
end
wait(.5)
status.Value = "Game Over"
wait(2)
local winners = {}
for i,v in pairs(game:GetService("Players"):GetChildren())do
if v.Backpack.Won.Value == true then
winners[i] = v.Name
end
end
wait()
for i = 0, 5 do
wait()
lobbyMusic.Volume = lobbyMusic.Volume + .1
i = i + 1
end
wait()
status.Value = "Winners Are: "..table.concat(winners,", ")
for i,v in pairs(game:GetService("Players"):GetChildren()) do
local char = v.Character
if v:WaitForChild("InGame").Value == true then
char.Humanoid.Health = 0
end
end
end
