Trying to make weapons only able to purchase when Murderer
8 replies, posted
Here is my code which I tried to figure out myself but I don't think it's right:
[url]http://paste.ubuntu.com/7606054/[/url]
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?
[url]http://paste.ubuntu.com/7606097/[/url]
[lua]
function ITEM:CanPlayerBuy(ply)
return ply:Team() == TEAM_WHATEVER
end
[/lua]
[url]http://paste.ubuntu.com/7606101/[/url]
[QUOTE=Judd;45022949][url]http://paste.ubuntu.com/7606101/[/url][/QUOTE]
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 :/
It's ply:GetMurderer() if I remember correctly
[lua]function ITEM:CanPlayerBuy(ply)
return ply:GetMurderer()
end[/lua]
[QUOTE=Internet1001;45024048]It's ply:GetMurderer() if I remember correctly
[lua]function ITEM:CanPlayerBuy(ply)
return ply:GetMurderer()
end[/lua][/QUOTE]
that did it, thank you!
Sorry, you need to Log In to post a reply to this thread.