CorePackages Service Security Error

Hi, I’ve been trying to follow the official Roblox Lua style guide: (Roblox Lua Style guide) and am having an issue with one part in particular under the “Requires” heading when it comes to importing modules from a different package.

I’ve tried accessing the CorePackaging service myself, and then a package “Basics” I have loaded in-game (i.e it’s listed under “Packages” in the game explorer):

local CorePackages = game:GetService("CorePackages")
local Basics = require(CorePackages.Basics)

But I get the error “The current identity (2) cannot Class security check (lacking permission 5)” on that second line when I try to run it from a LocalScript. Am I misunderstanding something? Or is the style guide outdated?

Thanks.

2 Likes

I don’t really know what CorePackages is, but I’m assuming you don’t have the security clearance (as in, us regular people can’t touch that).

Have you tried it with ModuleScript?
If that doesnt work, I don’t know.

CorePackages are only meant for CoreScripts made by Roblox. If you’d like to gain access to them, you must grab a copy of the package from

Studio Version Folder → Extra Content → Lua Packages

However, I believe most of them were made specifically for Core purposes, so most wouldn’t work for developers.

2 Likes

Ah I see, thank you very much! Just find it a bit odd that the style guide recommended doing that then.

I forgot to include this in my reply, but if you were to grab Roact for instance, don’t copy the Roact.lua file directly, I believe the main module for Roact is located here

Studio Version Folder → Extra Content → Lua Packages → Packages → _Index → roblox_roact

Same goes for the other packages.

Edit:
Or just grab them directly from the Roblox Github

3 Likes

Thanks, this is very helpful!:slight_smile: