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

How do I make this script show how many enemies are left?

Asked by 10 years ago

print 'WavetimerGUI script loaded'

game.ReplicatedStorage.Alien.Parent = game.Workspace game.StarterGui.WaveCounterGUI.Frame.Text = "Martians left:

0
Wouldn't mind an answer... GammaGeek 0 — 10y

1 answer

Log in to vote
1
Answered by 10 years ago

Use a for in pairs loop!

Number = 0
for i, v in pairs(Workspace:GetChildren) do
    if v.Name == "Alien" then
        Number = Number + 1
    end
end
print(Number)
Ad

Answer this question