Gmod TTT Lua Help

idk if this belongs in the help and support or here sry if this is the wrong one but this involves lua so i thought it might be in here

i got pointshop on my server and i wanted to restrict categories it to certain ranks so i edited it to try to restrict it so no one under vip can use it but then i cant open it and im owner it doesn’t show up in pointshop for me if this is the wrong one sry please and thank you for all your help

CATEGORY.Name = 'Guns'
CATEGORY.Icon = 'bomb'
CATEGORY.Order = -1
CATEGORY.AllowedUserGroups = { "vip", "vip+", "mod", "supermod", "admin", "superadmin", "co-owner", "owner", "FullPower" }

Try this:
function CATEGORY:CanPlayerSee( ply )
return //Any check goes here

You were saying?

ok wait so how am i supposed to make it work
and geferon i beleive he was looking at this because i cant see it but idk if thats right i just want it fixed

Oh fuck
I didnt see that function


ok well i just want a way to fix it so can anyone please help

I mean really…

ok so what do i put just a big list of all the groups i want to be allowed to use it for that function?

First, this thread doesn’t involve TTT. You are talking about the pointshop addon. Second, you guys aren’t understanding his post. He wants to prevent the pointshop from ever opening for those who aren’t of a certain status. Modifying the visibility of categories does not accomplish that.

ok oops im sorry for explaining my problem wrong i want to restrict categories to certain ranks but it wont work

[editline]16th October 2015[/editline]

and this is TTT server

Again, the thread itself is about pointshop, not ttt - pointshop wasnt made JUST for ttt.

ok well im using it on a TTT server if that helps but can someone please just help me with this and forget everything else this has been up over 12 hrs

He clearly wants only players from a certain group to see the ‘Guns’ category, he never said anything about the whole pointshop.

And as for your question, use table.HasValue, and use ply:GetUserGroup() to get the rank.
Another way to do would be creating a table with all the ranks, and setting which ones can or can’t see it using “true” and “false”
[lua]local ranks = {
“owner” = true,
“VIP” = true,
“moderator” = false


function CATEGORY:CanPlayerSee( ply )
return ranks[ ply:GetUserGroup() ]

ok im gonna try this

didnt work

What exactly did you put in your code and what exactly didn’t work? (Lua error)

woah im sry i didnt see this sooner
ok well i cant find it cause i erased it but can you just help me with the normal one that ppl use