You can only buy traitor within the first 30 seconds of the round.

I have this donator plugin on my Pointshop by _Undefined so that you could buy Traitor and Detective, however, the problem is that people buys it like whenever they want which is abusive according to some players, and what I am requesting is a little help from you guys to make this so people could only buy Traitor within the first 30 seconds of the round.

Link to the Pointshop I am using:

That kind of plugins gonna drive away your player base, would not recommend.

Well I have already implemented it and it was suggested. If I see any rants about it from my players then I will remove it.

But it is important that I make it so you could only buy either within 30 seconds of round start.

canchooseteam = false
hook.Add(“TTTBeginRound”, function()
canchooseteam = true
canchooseteam = false

Just have it set the bool every round, check it serverside if they can or not.

The rest you can do yourself, no spoonfeeding today.

Agreed. I refuse to implement it on my own server for that same exact reason. It is a cheap way to receive traitor and those who save up a lot of points can repeatedly become traitor, ruining it for others since there is a certain limit for each map.

Trust me I’ve made it so it is not that simple to buy Traitor.

Buying traitor is stupid, when people stop playing who don’t buy traitor, the people who are buying stop playing because they never get the chance to buy traitor since everybody else is trying to. They found an easy, fair solution; randomization. Just stick with it.

Thank you for your opinions on this, though I still would like to know how to make this work.

What’s the problem with you, it’s his fault if he’ll lose his playerbase and what not. He’s asking for help, why don’t you just help him and stop this argument.

//Put this above the (serverside) code that lets you buy traitor
local canbuytraitor = false
hook.Add(“TTTBeginRound”, “CanBuyStuff”, function()
canbuytraitor = true
timer.Create(“canbuytraitor”, 30, 1, function()
canbuytraitor = false
hook.Add(“TTTEndRound”, “CanBuyStuffEND”, function()
canbuytraitor = false

if canbuytraitor then
//Buy code here
//Warn the player that he can’t buy
That code should do it, I can’t give you more since you haven’t shown us what code you already have.

This is my code for buying Traitor:

function ITEM:OnBuy(ply)

function ITEM:OnSell(ply)

Why not make the users buy it during the round preparation, add a limit to the amount of traitors that can be bought. When the traitors get selected, force the players who have bought the role to said role, and then continue on with the code’s life. Simple.
This is how I would personally do it.

Also, I would limit traitor purchases to 25% of possible traitors and make it so you have to wait 2 rounds before you can force traitor again.

If I only knew how to code things like that…