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

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

Asked by
sameb556 -12
2 years ago
Edited 2 years ago

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

0
Create a for loop echobloxia 21 — 2y
0
K sameb556 -12 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago

try this:

if workspace.InBossBattle:WaitForChild("Humanoid", 5) >= 1 then
    print("Worked")
else
    print("Doesnt Work")
end
0
it didn't seem to work i got this error: sameb556 -12 — 2y
0
ServerScriptService.BobScript:1: attempt to compare number <= nil sameb556 -12 — 2y
Ad

Answer this question