Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I check if there is a player in a folder?

I have a script in ServerScriptStorage that is supposed to check if there is a player in a folder

if #workspace.InBossBattle:GetChildren() >= 1 then
print("Worked")
end

but this doesnt seem to work

2 comments

0

Create a for loop

0

K

1 answer

try this:

if workspace.InBossBattle:WaitForChild("Humanoid", 5) >= 1 then
	print("Worked")
else
	print("Doesnt Work")
end

2 comments

0

it didn't seem to work i got this error:

0

ServerScriptService.BobScript:1: attempt to compare number <= nil

This discussion is preserved as it was. New answers, comments, and votes are closed.