• Traitor tickets not every round
    3 replies, posted
Hey bros and sisters! I have a question to you guys, who can actually code lua. I have a F3 Pointshop with traitor tickets but there are some VIP's that got kinda much points and they're buying every damn round traitor.. so the question to you guys: i want to do it that they can buy traitor in round 1 - in round 2 it is not allowed for them, and in round 3 they can buy it - round 4 they can't - round 5 they can - round 6 they can't blablabla i hope you know what i mean.. and i really appreciate every helpful comment/post below the topic. thanks guys! regards edit: dats the code [CODE]ITEM.Name = 'Traitor' ITEM.Price = 9500 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[/CODE]
Now I don't use TTT, but if there's a hook to check whether or not a round has ended, you could make a variable, such as "hasTraitored" and then set it to false every other round.
I don't have this personally - but you can try [url]http://www.zombiemaster.org/smf/index.php?topic=12032.0[/url]
alright im testin
Sorry, you need to Log In to post a reply to this thread.