The second parameter of hook.add is the unique name, which as the name implies, must be unique. So because you’re creating a new hook for every player that buys the item, its overwriting the old hook.
If you need a better explanation, run your code on a server with another player. You buy the item first and do the taunt. If your code actually works, get the other player to buy the item, then you try to do the taunt again.
Going off what Niandra said, I would suggest moving the hook outside of the buy item and having 1 hook do it all and just ensure that they don’t have any other taunts active.
Maybe something like this. Its untested but it should in theory work better.
hook.Add(“KeyPress”, “taunts_handler”, function( ply, key )
//Check if the key pressed was the reload key
if key == IN_RELOAD then
//Check what taunt the player has active
if ply.Taunt != nil then
//Check the time since the last taunt
if ply.TauntTime == nil then ply.TauntTime = CurTime() end
if CurTime() > ply.TauntTime then
//Do the taunt stuff for the item
ply.TauntTime = CurTime() + 30
ITEM.Name = ‘This is Sparta!’
ITEM.Price = 30000
ITEM.Model = ‘models/props_junk/garbage_glassbottle003a.mdl’
ITEM.NoPreview = true
function ITEM:OnEquip( ply, modifications )
ply.Taunt = self.Name
ply.Taunt = nil