FLAG_STATUS_DORMANT = 0 FLAG_STATUS_CARRIED = 1 function ForceBombOntoPlayer(player) local bomb = ents.FindByClass("item_teamflag") bomb.m_nFlagStatus = FLAG_STATUS_CARRIED bomb.m_hMoveParent = player bomb.m_hParent = player bomb.m_pParent = player player.m_hItem = bomb bomb:SetParentAttachment("flag") end function TraceAndStopShort(tracetable) local trace1 = util.Trace(tracetable) local trace2 = util.Trace({ angles = tracetable.angles * -1, pos = trace1.HitPos, distance = 0.001, }) end function HasTag(bot, tagname) if bot:IsRealPlayer() or not bot:IsAlive() then return false end for _, tag in pairs(bot.szTagList()) do if tag == tagname then return true end end return false end function OnWaveSpawnBot(bot, wave, tags) bot.szTagList = tags if ents.FindByClass("item_teamflag").m_nFlagStatus == FLAG_STATUS_DORMANT then ForceBombOntoPlayer(bot) end end