I believe that tables don't have Characters.
Let's see here.
You are using GetChildren() incorrectly, if you read the article I provided you with, it says
Returns an array of the object's children.
Now, what is that?
An array is basically a Table.
You are trying to get a Character of a Table!
So that is what's wrong!
Now, if you dig deeper into the article, you'll see an example of how to use GetChildren().
for index, child in pairs(workspace:GetChildren()) do
print(index, child.Name)
end
That is called a Generic For Loop, which loops through tables, like GetChildren().
So by combining the knowledge we got with this answer, we can now properly use GetChildren!
local GameRunning = false
if game.Players.NumPlayers > 0 and not GameRunning then
GameRunning = true
for i,Player in pairs(game.Players:GetPlayers()) do
Player.Character.Torso.CFrame = game.Workspace.LivingRoom.CFrame
end
else
GameRunning = false
end
Now, we fixed this problem, but there's another one, you're only checking once!
Say you wanted a game to start if there were more than 1 person, then you wrote this
if game.Players.NumPlayers > 1 then
end
That would check, but it'll only check once.
The number of players to start is supposed to be 2+, but if I join, the script will check once, and it'll finish, so that won't work!
so what we can do is hook it up to the PlayerAdded event!
game.Players.PlayerAdded:connect(function(plr)
if game.Players.NumPlayers > 1 then
end
end)
And there you go!
If you use my scripts, in the future, you'll see some problems, but that is for you to sort out!