#I need help retrieving all the players in my game

1 messages · Page 1 of 1 (latest)

knotty hornet
#

ah super easy if it's actually in the player

#

as in were the playergui is and were you put the leaderstats

#

and not the character in the screen

#

then you just use Players:GetPlayers()

#

which returns a table of all players

#

iterate that table, ask which has the strong class bool value, and send the message to them

#
for _, player in Players:GetPlayers() do
  if player.StrongClass.Value == true then
    -- code
  end
end
#

okay then It beg the question

#

were it is

#

give as much info as you can, if you are looking for an instance then please remember to put a screenshot of your explorer of were that value you're looking for is

#

ah then you did not did what I said

#

you absolutely botched it 😅

#

the bool value IS directly under the player

#

`lua

#

for i, v in pairs(game:GetService("Players"):GetDescendants()) do

#

here you're iterating each descendant

#

AND THEN

#

if v:FindFirstChild("BruteClass") then

#

asking if the descendant has the brute class childed

#

you basically asked the brute class bool value if there was another bool value of the same name under it

knotty hornet
#

literally that

#

that's your homework, cannot make it simpler for you.

#

you need to put of your part too