Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I can't seem to figure out why the script won't run?

Asked by 10 years ago
01repeat wait()
02until game.Players.NumPlayers >= 2 wait(10)
03 
04local Officer = game.ReplicatedStorage.Characters.Officer:GetChildren()
05 
06local Cops = {Officer}
07 
08local SelcCop = nil
09 
10function CopSelect()
11    for i, v in pairs(Cops) do
12        if game.Players.NumPlayers >= 2 and game.Players.NumPlayers <= 12 then
13            SelcCop = game.Players:GetChildren()[math.random(1, game.Players.NumPlayers)]
14            for _,l in pairs(SelcCop:GetChildren()) do
15                if l:IsA("CharacterAppearance") then
View all 24 lines...

I'm trying to get it to select the 2 players as cops, but it will never run.

0
Also, there is nothing in output when i go to test it. TREVOR818730 25 — 10y

1 answer

Log in to vote
0
Answered by 10 years ago

Put some prints in there to check to see where it stops. So like:

01repeat wait()
02until game.Players.NumPlayers >= 2
03 wait(10)
04print("Cops Selected")
05local Officer = game.ReplicatedStorage.Characters.Officer:GetChildren()
06local Cops = {Officer}
07local SelcCop = nil
08function CopSelect()
09print("Cops Being Customized")
10    for i, v in pairs(Cops) do
11        if game.Players.NumPlayers >= 2 and game.Players.NumPlayers <= 12 then
12            SelcCop = game.Players:GetChildren()[math.random(1, game.Players.NumPlayers)]
13print("OH SNAP TIME TO START")
14            for _,l in pairs(SelcCop:GetChildren()) do
15                if l:IsA("CharacterAppearance") then
View all 25 lines...
0
thanks, i really figured prints were a waste of lines, guess not. TREVOR818730 25 — 10y
0
No problem! deputychicken 226 — 10y
Ad

Answer this question