Problem with a script

Heyy!
I have a problem, I want if there’s something in the file, then it says “Work”. But it doesn’t work: Why?

while true do
	
	wait(0.1)
	
	local Children = game.Workspace.InLobby:GetChildren()
	local AmountOfChildren = #Children
	  
	if AmountOfChildren >= 1 then	
	print("Work")
	wait(0.1)
	end
end

Any errors in the output?

30Characters

No error :confused: 30 Characters

It’s a script in ServerScriptService

So you want to see if the length of children is less than or equal to one?

Try this and let me know if anything changes:

while wait() do
    if #workspace.InLobby:GetChildren() >= 1 then
        print("Work")
    end
end

Doesn’t work ;-; And I don’t have an error :confused:

Is anything being added to “InLobby” ?

Maybe it got confused of the two children I clearly dont know

It actually works propely, maybe try checking players in that way:

local Children = game.Players:GetPlayers()

If not, check if anything is added to InLobby

Yeah, well, there are some things in the folder

Can I see your Explorer window along with your script?

When I click on the Play Button, The player Chararter is in the folder InLobby

Answer the question, are you trying to check if it’s greater than or less than 1

Are you using RemoteEvents for when the button is pressed? If not, the server will not see the request.

He trying to check if there is greater than or equal to 1

He wants to know if there are >= 1 number of children in the folder

If this is at the beginning of a script. Its possible it hasn’t loaded in yet.
Use

workspace:WaitForChild("InLobby"):GetChildren()


or

while true do
	
	wait(0.1)
	
	local Children = workspace:WaitForChild("InLobby"):GetChildren()
	local AmountOfChildren = #Children
	  
	if AmountOfChildren >= 1 then	
	print("Work")
	wait(0.1)
	end
end

I’m asking if he is actually trying to check if its or if he is trying to do the other way

Doesn’t work :confused: idk why …