ModuleScript
local RS = game:GetService("ReplicatedStorage")
local GS = game:GetService("GuiService")
local UIS = game:GetService("UserInputService")
local module = {}
--Set selection group
function module.SelectionGroupToggle(parentObj, bool)
--GS:AddSelectionParent(name, parentObj), this is apparently glitchy/broken since 2015 so no thanks
local descendants = parentObj:GetDescendants() --here's where it throws the error
for index, descendant in pairs(descendants) do
if descendant:IsA("GuiButton") then
descendant.Selectable = bool
end
end
return true
end
return module
LocalScript
local KB = require(script:WaitForChild("KeybindModule"))
local introFrame = script.Parent:WaitForChild("IntroFrame")
KB:SelectionGroupToggle(introFrame, false)
KeybindModule:11: attempt to call method 'GetDescendants' (a nil value)
Why does it seem to think my introFrame object is a nil value?
In the LocalScript, printing the name of the object returns a value. Printing it in the module returns nil.