Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

The current identity (2) cannot Class security check (lacking permission 6)?

for _,child in pairs(game:GetChildren()) do local text = script.Parent text.Text = child.Name local newText = text:Clone() newText.Script:Destroy() newText.Parent = text.Parent newText.Visible = true end

4 comments

0

This doesn't seem like all your code is here.

0

It is impossible for the given code to error "cannot Class security check". Please provide all of your code so that we can help.

0

Nevermind I'm wrong, you're doing game:GetChildren() which sometimes returns hidden objects on which you cannot check for the class.

0

what do i do then

1 answer

✓ Accepted answer

You're getting that error because some children of game aren't accessible to normal scripts. I don't know what you want to do so I can't suggest a better way, but if you really have to do it this way, use pcall to prevent the errors, like so:

for _,child in pairs(game:GetChildren()) do
	pcall(function()
		local text = script.Parent
		text.Text = child.Name
		local newText = text:Clone()
		newText.Script:Destroy()
		newText.Parent = text.Parent
		newText.Visible = true
	end)
end

1 comment

0

ill try that but first ill do local scripts

This discussion is preserved as it was. New answers, comments, and votes are closed.