``players = #game.Players:GetPlayers()
how can I change this so only if the player has a inGame score of 1 it will see the player as a player?
Inside the player I have a boolvalue named "inGame"
``players = #game.Players:GetPlayers()
how can I change this so only if the player has a inGame score of 1 it will see the player as a player?
Inside the player I have a boolvalue named "inGame"
Firstly you cannot make delete players. I normally use a for i,v loop for this kind of stuff. I use :GetChildren() if the instance is directly under the instance you are looping through. If it is not directly under that instance you are looping through you use :GetDescandents.The diffrence between :GetChildren() and :GetDescandents is that :GetChildren only gets the direct children under the instance, :GetDescandents loops through the children of the instance you are looping through aswell
local players = game.Players
for i,v in pairs(players:GetDescendants()) do
if v.Name == "inGame" then -- Get the instance name what you are looking for
-- Run code here
end
end
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
problem with that is 1) inGame is a vlue inside the players, not his name 2) it still doesn't count the amount of players
RedCommanderV2 You did not read the question correctly both your arguments are false 1. He asked quoted: "Inside the player I have a boolvalue named "inGame"" So the value is in players 2. He never asked to count the players.