The current thread cannot access 'StreamingService' (lacking capability Assistant)

Running a v:IsA() on a child of game:GetDescendants() seems to emit an error:

The current thread cannot access ‘StreamingService’ (lacking capability Assistant)

Example:

for i,v in pairs(game:GetDescendants()) do
	if v:IsA("BasePart") then
		print("Test")
	end
end

Expected behavior

Using v:IsA() on a child of game:GetDescendants() should run normally

A private message is associated with this bug report

8 Likes

I’m starting to see this is well thank you for reporting it. :slight_smile:

1 Like


Same here, broke the UI on my game.

1 Like

Same problem here. You just gotta love testing in production.

1 Like

Same happens for one of my plugins.

I can’t even use a bunch of my plugins because of this.
Good job Roblox. Let’s see how many years it takes to fix this one.


Best regards,
Pinker

try my solution

for i, v in {workspace, game.ReplicatedStorage, game.ReplicatedFirst, game.StarterGui, game.StarterPack} do
	for i,v in v:GetDescendants() do
		if v:IsA("BasePart") then
			print("Test")
		end
	end
end

i dont know why my answer got deleted, but here is some explanation
StreamingService is child of DataModel.
According to error
Regular scripts can’t mess with that except for scripts with higher permissions.

the current solution is don’t use game:GetDescendants()
use the merged table of multiple objects

like this

for i, v in {workspace, game.ReplicatedStorage, game.ReplicatedFirst, game.StarterGui, game.StarterPack} do
	for i,v in v:GetDescendants() do
		if v:IsA("BasePart") then
			print("Test")
		end
	end
end

Thank you for the report. We’ve identified the issue and expect a fix to ship with the Studio release next week. This issue should only affect Studio sessions and not production servers.

If you need a workaround in the meantime, you can wrap the if statement in a pcall:

for _, v in game:GetDescendants() do
	pcall(function()
		if v:IsA("BasePart") then
			print("Test")
		end
	end)
end
2 Likes

Another workaround is to simply just test in Roblox Player: it’s frustrating but prevents any unnecessary changes to be made to scripts.

1 Like
for i,v in pairs(game:GetDescendants()) do
	if  v ~= game.StreamingService and v:IsA("BasePart") then
		print("Test")
	end
end

yooo it worksss

1 Like

I believe that external features may have a role in some of these errors. My game that has several contributions on it is getting this error even when I remove and disable all uses of game:GetDescendants() like the one used in our loading screen.