Why my script isn't working or perhap i put it wrong place?
Please make your question title relevant to your question content. It should be a one-sentence summary in question form.
minigames = game.Lighting.Minigames.GetChildren()
h = Instance .new("Hint",game.Workspace)
while true do
if game.Players.NumPlayers > 1 then
h.Text = "Choosing Random Minigame..."
wait(2)
ranGame = math.random(1,#minigames)
gameChosen = minigames[ranGame]
h.Text = "Minigame Chosen --- " ..gameChosen.Name
wait(3)
gameChosenClone = gameChosen:Clone()
gameChosenClone.Parent = game.Workspace
wait(3)
--Teleport People To Map :D
spawns = gameChosenClone.Spawns:GetChildren()
for i,v in pairs(game.Player:GetPlayer()) do
name = v.Name
check = game.Workspace:FindFirstChild(name)
if check then
checkHumanoid = check:FindFirstChild("Humanoid")
if checkHumanoid then
check:MoveTo(spawns[i].Position)
end
end
end
for i = 3,0,-1 do
h.Text = "Game Begins In: " .. i
wait(1)
end
--Countdown until the game ends
for i = 10,1,-1 do
h.Text = "Time left: " .. i
wait(1)
end
h.Text = "Game Ended!"
wait(3)
gameChosenClone:Destroy()
else
h.Text = "There needs to be at least 2 player to start"
end
wait(1)
end