Lacking permission (6)

local Doors = {}
-- Variables

Doors.Func = function()
    local obj = nil
    
    -- // i, v in pair loop finds the values parent
    for index, descendant in pairs(game:GetDescendants()) do
        if descendant:IsA("ObjectValue") and descendant.Name == "ValueEvent"then
            print(descendant.Parent)
        end
    end  
end

return Doors

image

I just started modules today and I have NO idea what to do.

Any help would be really appreciated! : D

There are services like CoreGui which regular game scripts would not have access to which are descendants of game.

For this case, you might want to use a recursive :FindFirsChild, it will make looking for your ValueBase easier.

local value = game:FindFirstChild("ValueEvent", true)

if value and value:IsA("ObjectValue") then
    -- stuff
end
2 Likes

Thanks so much man! I really appreciate it, I probably would’ve never figured that out! :slight_smile: