::AWP_RED <- { OnGameEvent_recalculate_holidays = function(_) { if(GetRoundState() == 3) { delete ::AWP_RED } } PillPopper = function() { local hHealer = activator local hPatient = self if(hPatient.GetTeam() == hHealer.GetTeam()) { local flHealth = hPatient.GetHealth() hPatient.SetHealth(flHealth + 50) local flMaxHealth = hPatient.GetMaxHealth() if(hPatient.GetHealth() > flMaxHealth) hPatient.SetHealth(flMaxHealth) flHealth = hPatient.GetHealth() - flHealth if(flHealth > 0) { EmitSoundOn("Weapon_Arrow.ImpactFleshCrossbowHeal", hPatient) local hPlayerManager = FindByClassname(null, "tf_player_manager") local GetUserIDFromIndex = @(iIndex) GetPropIntArray(hPlayerManager, "m_iUserID", iIndex) local iPatientIndex = hPatient.entindex() local iPatientUserID = GetUserIDFromIndex(iPatientIndex) local iHealerUserID = GetUserIDFromIndex(hHealer.entindex()) local hPatientWeapon = hPatient.GetActiveWeapon() SendGlobalGameEvent("player_healed", { patient = iPatientUserID healer = iHealerUserID amount = flHealth }) SendGlobalGameEvent("player_healonhit", { entindex = iPatientIndex weapon_def_index = hPatientWeapon ? GetPropInt(hPatientWeapon, "m_AttributeManager.m_Item.m_iItemDefinitionIndex") : -1 amount = flHealth }) SendGlobalGameEvent("crossbow_heal", { patient = iPatientUserID healer = iHealerUserID amount = flHealth }) } } } PolarityPoint = function() { local hPlayer = self local hPolarityPoint for(local i = 0; i <= 8; i++) { local hWeapon = GetPropEntityArray(hPlayer, "m_hMyWeapons", i) if(hWeapon && hWeapon.GetSlot() == 1) { hPolarityPoint = hWeapon; break } } if(!hPolarityPoint) return hPolarityPoint.ValidateScriptScope() local hPolarityPoint_scope = hPolarityPoint.GetScriptScope() hPolarityPoint_scope.hPlayer <- hPlayer hPolarityPoint_scope.iButtonsLast <- 0 hPolarityPoint_scope.Think <- function() { local iButtons = GetPropInt(hPlayer, "m_nButtons") local iButtonsChanged = iButtonsLast ^ iButtons local iButtonsPressed = iButtonsChanged & iButtons local iButtonsReleased = iButtonsChanged & (~iButtons) iButtonsLast = iButtons local hActiveWeapon = hPlayer.GetActiveWeapon() if(hActiveWeapon == self) { if(iButtonsPressed & IN_ATTACK3) { EmitSoundOnClient("Weapon_StickyBombLauncher.Single", hPlayer) SetPropInt(hPlayer, "m_afButtonForced", IN_ATTACK) EntFireByHandle(hPlayer, "RunScriptCode", "SetPropInt(self, `m_afButtonForced`, 0)", 0.066, null, null) // SetPropInt(hPlayer, "m_afButtonForced", 0) } } return -1 } AddThinkToEnt(hPolarityPoint, "Think") } } __CollectGameEventCallbacks(AWP_RED)