CollectionService bug - The current identity (2) cannot Class security check (lacking permission 5)

This bug started happening in my game yesterday after a roblox update. Here is the code and place to reproduce the error. It happened with objects in StarterGui that get added to PlayerGui. Adding a wait() right before you do anything with the child fixes the error, so my guess is that InstanceAddedSignal is being called before the object finishes loading to PlayerGui.

local CollectionService = game:GetService("CollectionService")

local function Check(child, where)
	local s, e = pcall(function()
		return child.Parent
	end)
	print(where..":", child.Name, "-", s)
    error(e)
end

for _, child in ipairs(CollectionService:GetTagged("Button"))do
	Check(child, "Get")
end

CollectionService:GetInstanceAddedSignal("Button"):Connect(function(child)
	--wait()
	Check(child, "Add")
end)

--OUTPUT
-- Add: TextButton - false

--OUTPUT with wait()
-- Add: TextButton - true

CollectionServiceBug.rbxl (15.7 KB)

2 Likes

Hi,

Thanks for reporting the issue! The feature which may have caused this error is now turned off. Can you confirm if that fixes your issue?

3 Likes

Yea, the issue is fixed. Thanks for the quick response!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.