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:
http://paste.ubuntu.com/7606054/

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?

[lua]
function ITEM:CanPlayerBuy(ply)
return ply:Team() == TEAM_WHATEVER
end
[/lua]

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()
end[/lua]

that did it, thank you!