[TTT] Pointshop problem.

I’ve been having a problem it’s problably very simple fix but I can’t figure it out.

It’s a TTT Force Traitor script in Pointshop. You buy it and it says " Bought Traitor for 8000 points. " " Single use item. You’ll have to buy this item another time! " and it does not make you traitor. Here is the code.


TRAITOR = ttt_force_traitor

ITEM.Name = 'Traitor'
ITEM.Price = 8000
ITEM.Material = 'VGUI/ttt/sprite_traitor.vmt'
ITEM.SingleUse = true

function ITEM:OnEquip(ply, modifications)
hook.Add("TTTBeginRound", ply:UniqueID() .. "_traitor", function()
    if not 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

Seems like there’s no issue with the script. If you’re already innocent/detective and you buy it, it won’t force you to change the group. You’ll have to buy yourself traitor during the preparing time.

-Snip-
Due to being picky learn lua

Ok, that works! But it adds a traitor to the game instead of chooses.

-snip-

I fixed it. I just removed it entirely. People weren’t liking it. But thanks anyway.