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

FindFirstChild is not a valid member of workspace error for no reason?

Asked by
fifayy 28
3 years ago

I was looking at a Region3 roblox scripting tutorial and when i was tryping the script i finished it then i clicked play it show the error of "FindFirstChild is not a valid member of workspace".

Here is my script

local region = Region3.new(Vector3.new(5,0,5), Vector3.new(15,15,15))

local part = Instance.new("Part")
part.Anchored = true
part.Size = region.Size
part.Parent = game.Workspace
part.CanCollide = false
part.Transparency = 0.9


while true do
    wait()
    local thingsinRegion = workspace:FindPartsInRegion3(region, part, 1000)
    for i, part in pairs (thingsinRegion)do
        if part.Parent:findFirstchild("Humanoid") ~= nil then 
            print("Player found in the region")
            local playername = part.Parent.Name
        end
    end
end

2 answers

Log in to vote
0
Answered by 3 years ago

I'm not 100% sure, but in line 15, you used ':findFirstChild' when it should be ':FindFirstChild'.

Ad
Log in to vote
0
Answered by
Neatwyy 123
3 years ago

In line 15, you used :findFirstChild instead of :FindFirstChild.

Answer this question