Will someone tell me why line 31 keeps erroring out and whats causing it?
I'm making a minigames game but the main script it errors out every time on line 31.... will someone please tell me why? and fix it?
01 | minigames = game.Lighting.minigames:GetChildren() |
03 | h = Instance.new( "Hint" , Workspace) |
06 | plates = game.Workspace.DissapearingPlates.Plates:GetChildren() |
07 | ranNum 1 = math.random( 1 , #plates) |
09 | while ranNum 1 = = ranNum 2 do |
10 | ranNum 2 = math.random( 1 , #plates) |
13 | plateChosen = plates(ranNum 1 ) |
14 | plateChosen 2 = plates(ranNum 2 ) |
16 | plateChosen = plates(ranNum 1 ) |
17 | plateChosen 2 = plates(ranNum 2 ) |
19 | plateChosen.Transparency = i |
20 | plateChosen 2. Transparency = i |
24 | plateChosen 2 :Destroy() |
30 | if game.Players.NumPlayers > 1 then |
31 | h.Text = "Deciding which game to play." |
33 | ranGame = math.random( 1 , #minigames) |
34 | gameChosen = minigames(ranGame) |
35 | h.Text = "Minigame chosen: " ..gameChosen.Name |
37 | gameChosenClone = gameChosen:Clone() |
38 | gameChosenClone.Parent = game.Workspace |
41 | spawns = gameChosenClone.Spawns:GetChildren() |
42 | for i, v in pairs (game.Players:GetPlayers()) do |
44 | check = game.Workspace:FindFirstChild(name) |
46 | checkHumanoid = check:FindFirstChild( "Humanoid" ) |
48 | check:MoveTo(spawns [ i ] .Position) |
53 | h.Text = "Game Begins: " .. i |
56 | if gameChosenClone.Name = = "DissapearingPlates" then |
60 | for i = timeTilGameEnds, 1 , - 1 do |
61 | h.Text = "Time Left : " .. i |
64 | h.Text = "Game ended!" |
66 | h.Text = "Giving Points to players who won" |
67 | for i, v in pairs (game.Players:GetPlayers()) do |
68 | ingame = v:FindFirstChild( "InGame" ) |
70 | v.leaderstats.Points.Value = v.leaderstats.Points.Value + 10 |
74 | gameChosenClone:Destroy() |
78 | h.Text = "there needs to be more than 1 player to start" |