[lua]ITEM.Name = '<span class="highlight">Traitor</span>'
ITEM.Price = 2000
ITEM.Material = 'VGUI/ttt/sprite_traitor.vmt'
ITEM.OneUse = true
if SERVER then
local plymeta = FindMetaTable( "Player" )
if not plymeta then return end
plymeta.inTraitorCooldown = false
end
function ITEM:CanPlayerBuy(ply)
return ply.inTraitorCooldown
end
function ITEM:OnEquip(ply, modifications)
hook.Add("TTTBeginRound", ply:UniqueID() .. "_traitor", function()
if ply:GetRoleString() != "<span class="highlight">traitor</span>" then
ply:SetRole(ROLE_TRAITOR)
ply:AddCredits(GetConVarNumber("ttt_credits_starting"))
end
if SERVER then
ply.inTraitorCooldown = true
timer.Simple(1200, function() ply.inTraitorCooldown = false end)
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[/lua]
It show's up, just when i click to buy, it doesn't equip or work.
Are you asking us to help fix it?
This thread is more like a statement.
Sorry, you need to Log In to post a reply to this thread.