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

Whats the opposite of append?

Asked by 4 years ago

So often when you want to check what's outside of something you use append. But I am wondering how you can check what's inside of something. Example

game.Players

I can't be sure what will be in there because players have random names. But is there a way to for example print all the players that are inside players?

0
This is a really bad question ik. One way i might now is to use getchildren. But I don't understand how to use getchildren. Skydoeskey 108 — 4y
0
depend nc2r 117 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

Sure you can use getchildren for one.

That would look something like this

for i,v in pairs(workspace.Model:GetChildren())do
    print(v)
end

for players you should use

for i,v in pairs(Players:GetPlayers())do
    print(v)
end--this does the same thing :)
Ad

Answer this question