Trying to make weapons only able to purchase when Murderer

Here is my code which I tried to figure out myself but I don’t think it’s right:

I’m basically trying to make it so you can only buy and use a weapon if you are a murderer and not a bystander in the Murder game mode by Mechanical Mind

I couldn’t find a reference to the actual team names either so I’m not sure if those team names would work or not.

Any help would be greatly appreciated, trying to learn what I can.

You’ll need to start with the canbuy func as opposed to on buy.

like this?

function ITEM:CanPlayerBuy(ply)
return ply:Team() == TEAM_WHATEVER

I don’t know why you’re posting that here, just test it yourself.

Not sure where I messed up but I don’t think it likes Murderer as a team name :confused:

It’s ply:GetMurderer() if I remember correctly
[lua]function ITEM:CanPlayerBuy(ply)
return ply:GetMurderer()

that did it, thank you!