How do you restrict PAC3 to admin only?

I have an addon called PAC3 and I need to restrict it to admin only. How would I do this?

The addon is normally accessed through the context menu.


You can use the PrePACConfigApply hook and return false for any non-Admin.

if !ply:IsAdmin() then return false

Where do I put this code of code and where do I save the whole script in my files as I have the workshop version of PAC3



You haven’t defined “!ply” so this won’t work.


Nevermind, returning true seems to break this hook

Doing that would break the hook.

Would actually work fine. You wouldn’t easily be able to use an object named “!ply” anyway, and not at all without grabbing is via indexing. As long and ply exists and is a player “!ply:IsAdmin()” would work just fine.