function ITEM:OnBuy(ply)
ply:Give(self.WeaponClass)
ply:SelectWeapon(self.WeaponClass)
end
function ITEM:OnSell(ply)
ply:StripWeapon(self.WeaponClass)
end
How would I make a !donate command to sned the person to the steam browser and go to my specified page, I have tryed using this command beofre from diffrent codes and none worked for me
Thanks!
(User was banned for this post ("wrong section" - postal))
So let me get this straight you want it so they can only buy the item once a round?
You could use NWBools. When the player buys it for the round it is set, then if it is set to true they can not buy another. I can’t recall which file, but if you dig around the TTT code a little you can find where to have it reset each round.
Think it is player_ext.lua
This code below what it does is it only allows them to buy it if they currently don’t have it in their inventory. So basically they could just drop it and buy a new one. You would need to store purchases in order to full check. Also this will charge the player even if they attempt to buy it again and they can’t. So like if you have ak and buy it again, you wont get an ak but it will still charge you. A text will appear in chat saying, “You already have this weapon”. May I suggest posting a job on CoderHire But hope this helps and enjoy!
function ITEM:OnBuy(ply)
if ply:HasWeapon( “weapon_ak47” ) then
ply:ChatPrint(“You already have this weapon!”)
else
ply:Give(self.WeaponClass)
ply:SelectWeapon(self.WeaponClass)
end
end
function ITEM:OnSell(ply)
ply:StripWeapon(self.WeaponClass)
end