function OnGameEvent_player_spawn(params) { local player = GetPlayerFromUserID(params.userid) if(!IsPlayerABot(player)) { return } EntFireByHandle(player, "RunScriptCode", "spawnBotParticle2()", 0.5, null, null) //delay to allow properties to update } ::spawnBotParticle2 <- function() { if(self.HasBotTag("dont_highlight")) { return } NetProps.SetPropString(self, "m_iName", self.entindex().tostring()) //change the particle names local particleName = self.IsMiniBoss() ? "bot_highlight_giant" : "bot_highlight_normal" local particle = SpawnEntityGroupFromTable({ //apparently need to use this for parentname a = { info_particle_system = { targetname = "particle_" + self.entindex() effect_name = particleName start_active = true origin = self.GetCenter() parentname = self.GetName() } } }) } function OnGameEvent_player_death(params) { local player = GetPlayerFromUserID(params.userid) if(!IsPlayerABot(player)) { return } local particle = Entities.FindByName(null, "particle_" + player.entindex()) if(particle) { particle.Kill() } } __CollectGameEventCallbacks(this)