Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
1

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

Asked by
fifayy 16
4 months 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 4 months 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 4 months ago

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

Answer this question