I have been trying to use the
local players = game.Players:getChildren()
in my function , this is what i go.
if players == 1 then
print("Starting Minigame.")
print("Enough Players!")
m = Instnce.new("Message", game.Workspace)
m.Text = "Starting Minigame!"
wait(5)
m:Destroy()
end
I get no errors in the output, but nothing happens. I've tried the NumPlayers variable but it does nothing.... Anyone mind pointing me in the right direction?
====================== I've also been trying to create a leaderboard stats that once the wait() is up, it gives them tools?
Leaderboard:
function CreateStats(name, parent, value)
var = Instance.new("IntValue")
var.Name = name
var.Parent = parent
var.Value = value
end
function Entered(newplayer)
if newplayer:findFirstChild("leaderstats") == nil then
CreateStats("leaderstats", newplayer, 0)
CreateStats("Level", newplayer.leaderstats, 0)
end
end
game.Players.PlayerAdded:connect(Entered)
p = game.Players:GetChildren()
for i = 1, #p do
Entered(p[i])
end
The Timer:
if game.Players.LocalPlayer.leaderstats.Level.Value == 0 then
wait(2)
game.Players.LocalPlayer.leaderstats.Level = game.Players.LocalPlayer.leaderstats.Level.Value +1
wait(2)
m = Instance.new("Message", game.Workspace)
m.Text = "You've recieved build tools!"
wait(2)
m:Destroy()
elseif game.Players.LocalPlayer.leaderstats.Level.Value == 1 then
--Inserting random tools etc--
end
Thanks in advanced.

4 comments
Try game.Players.NumPlayers >=1 and also you mispelled Instance for the first message.
It's :GetChildren() not :getChildren()
It doesn't matter if you use 'getChildren' or 'GetChildren'. getChildren was original name of that method anyway, so it won't go anywhere.
getChildren and children are both references to the current GetChildren. They're deprecated, but only because you should aim to use the most up to date naming scheme.