Hello I'm trying to make a power up for ttt, the traitor item. it gives a traitor status for the next round and then vanishes. I'm wondering if it's at all possible
To make it so you can only buy this once every other round if not every third round. Here's the code. And I understand that this is most likely not possible.
ITEM.Name = 'Trait VIP'
ITEM.Price = 200
ITEM.Material = 'VGUI/ttt/sprite_traitor.vmt'
ITEM.OneUse = true
function ITEM:OnEquip(ply, modifications)
hook.Add("TTTBeginRound", ply:UniqueID() .. "_traitor", function()
if ply:GetRoleString() != "traitor" then
ply:SetRole(ROLE_TRAITOR)
ply:AddCredits(GetConVarNumber("ttt_credits_starting"))
end
if SERVER then
ply:PS_TakeItem(self.ID)
end
hook.Remove("TTTBeginRound", ply:UniqueID() .. "_traitor")
end)
end
function ITEM:OnHolster(ply)
hook.Remove("TTTBeginRound", ply:UniqueID() .. "_traitor")
end
function ITEM:OnSell(ply)
hook.Remove("TTTBeginRound", ply:UniqueID() .. "_traitor")
end
Bump?
You added the wrong code.
It is not supposed to be [QUOTE=]ITEM.OneUse = true[/QUOTE]
It is supposed to be [QUOTE=]ITEM.SingleUse = true[/QUOTE]
I hope this helps you.
[QUOTE=RussianGaming;42533034]You added the wrong code.
It is not supposed to be
It is supposed to be
I hope this helps you.[/QUOTE]
Wont That just allow it still to be used once every round? Some Of my donators who have a good amount of points buy this to often so I wanted to put a limit to purchase it every so often.
[QUOTE=fast0nitro;42538267]Wont That just allow it still to be used once every round? Some Of my donators who have a good amount of points buy this to often so I wanted to put a limit to purchase it every so often.[/QUOTE]
I am afraid that this is not possible.
Or it probalry is, but I dont know how to do it.
EDIT: I use the Buy Traitor item me too on my server, and I let them buy it each rounds. Maybe you should try and put the price of the Buy Traitor to maybe 600?
Anyone have any ideas?
Sorry, you need to Log In to post a reply to this thread.