//vscript by stardustspy //do not use without my credit PLEASE!!!!!!!!! ::TEAM_RED <- 2 ::TEAM_BLU <- 3 ::TF_NAV_SPAWN_ROOM_RED <- 2 ::TF_NAV_SPAWN_ROOM_BLUE <- 4 ::TF_BOT_FAKE_CLIENT <- 1337 ::MAX_COUNT_WEAPON_EQUPPED <- 8 ::TEAM_SPECTATOR <- 1 ::SOLID_NONE <- 0 ::CONTENTS_SOLID <- 1 ::CONTENTS_WINDOW <- 2 ::CONTENTS_GRATE <- 8 ::CONTENTS_MOVEABLE <- 16384 ::CONTENTS_PLAYERCLIP <- 65536 ::MASK_NPCWORLDSTATIC <- 131083 ::MASK_PLAYERSOLID <- 33636363 ::MASK_NPCSOLID <- 33701899 ::MASK_SOLID <- 33570827 ::MASK_SHOT <- 1174421507 ::PI <- 3.14159265359 ::gamerules <- Entities.FindByClassname(null, "tf_gamerules") ::player_manager <- Entities.FindByClassname(null, "tf_player_manager") ::WORLD_SPAWN <- Entities.FindByClassname(null, "worldspawn") ::MAX_COUNT_PLAYERS <- MaxClients().tointeger() ::MASK_VISIBLE_AND_NPCS <- 33579137 ::TF_DMG_FALLOFF <- 2097152 ::TF_DMG_BULLET <- 2 ::TF_DMG_CUSTOM_HEADSHOT <- 1 ::TF_DMG_CUSTOM_BACKSTAB <- 2 ::TF_DMG_CRITICAL <- 1048576 ::SND_NOFLAGS <- 0 ::SND_CHANGE_VOL <- 1 ::SND_CHANGE_PITCH <- 2 ::SND_STOP <- 4 ::SND_SPAWNING <- 8 ::SND_DELAY <- 16 ::SND_STOP_LOOPING <- 32 ::SND_SPEAKER <- 64 ::SND_SHOULDPAUSE <- 128 ::SND_IGNORE_PHONEMES <- 256 ::SND_IGNORE_NAME <- 512 ::SND_DO_NOT_OVERWRITE_EXISTING_ON_CHANNEL <- 1024 ::RECIPIENT_FILTER_GLOBAL <- 5 ::IGNORE_ENEMIES <- 1024 ::IN_ATTACK <- 1 ::IN_JUMP <- 2 ::IN_DUCK <- 4 ::IN_FORWARD <- 8 ::IN_BACK <- 16 ::IN_USE <- 32 ::IN_CANCEL <- 64 ::IN_LEFT <- 128 ::IN_RIGHT <- 256 ::IN_MOVELEFT <- 512 ::IN_MOVERIGHT <- 1024 ::IN_ATTACK2 <- 2048 ::IN_RUN <- 4096 ::IN_RELOAD <- 8192 ::IN_ALT1 <- 16384 ::IN_ALT2 <- 32768 ::IN_SCORE <- 65536 ::IN_SPEED <- 131072 ::IN_WALK <- 262144 ::IN_ZOOM <- 524288 ::IN_WEAPON1 <- 1048576 ::IN_WEAPON2 <- 2097152 ::IN_BULLRUSH <- 4194304 ::IN_GRENADE1 <- 8388608 ::IN_GRENADE2 <- 16777216 ::IN_ATTACK3 <- 33554432 const STRING_NETPROP_ITEMDEF = "m_AttributeManager.m_Item.m_iItemDefinitionIndex" const SLOT_COUNT = 7 const EFL_USER = 1048576 // EFL_IS_BEING_LIFTED_BY_BARNACLE const EFL_USER2 = 1073741824 //EFL_NO_PHYSCANNON_INTERACTION const SINGLE_TICK = 0.015 const DMG_NO_BULLET_FALLOFF = 2097152 PrecacheSound("ambient/energy/weld1.wav") PrecacheSound("ambient/energy/weld2.wav") PrecacheSound("player/recharged.wav") PrecacheSound("npc/assassin/ball_zap1.wav") PrecacheSound("weapons/drg_wrench_teleport.wav") PrecacheSound("misc/halloween/spell_lightning_ball_cast.wav") PrecacheSound("misc/halloween/spell_meteor_impact.wav") PrecacheSound("misc/halloween/spell_spawn_boss.wav") PrecacheSound("Weapon_Revolver.Single") PrecacheModel("models/empty.mdl") PrecacheSound("shooting_headshot.mp3") PrecacheSound("items/gift_pickup.wav") //fold ::ROOT <- getroottable(); if (!("ConstantNamingConvention" in ROOT)) // make sure folding is only done once { foreach (a,b in Constants) foreach (k,v in b) ROOT[k] <- v != null ? v : 0; } function GetItemInSlot(player, slot) { local item for (local i = 0; i < SLOT_COUNT; i++) { local wep = NetProps.GetPropEntityArray(player, "m_hMyWeapons", i) if ( wep == null || wep.GetSlot() != slot) continue item = wep break } return item } ::HelicopterRL <- { Cleanup = function() { // keep this at the end delete ::HelicopterRL } // mandatory events OnGameEvent_recalculate_holidays = function(_) { if (GetRoundState() == 3) { Cleanup() } } OnGameEvent_mvm_wave_complete = function(_) { Cleanup() } function PrintTable(table) { if (table == null) return; this.DoPrintTable(table, 0) } function DoPrintTable(table, indent) { local line = "" for (local i = 0; i < indent; i++) { line += " " } line += typeof table == "array" ? "[" : "{"; ClientPrint(null, 2, line) indent += 2 foreach(k, v in table) { line = "" for (local i = 0; i < indent; i++) { line += " " } line += k.tostring() line += " = " if (typeof v == "table" || typeof v == "array") { ClientPrint(null, 2, line) this.DoPrintTable(v, indent) } else { try { line += v.tostring() } catch (e) { line += typeof v } ClientPrint(null, 2, line) } } indent -= 2 line = "" for (local i = 0; i < indent; i++) { line += " " } line += typeof table == "array" ? "]" : "}"; ClientPrint(null, 2, line) } function CanBeHurt(entity) { local UberArray = [5, 8, 51, 52, 57] foreach(cond in UberArray) { if (entity.InCond(cond)) { return true } } return false } GetItemInSlot = function(player, slot) { local item for (local i = 0; i < SLOT_COUNT; i++) { local wep = NetProps.GetPropEntityArray(player, "m_hMyWeapons", i) if ( wep == null || wep.GetSlot() != slot) continue item = wep break } return item } StripWeapon = function(player, slot) { if (slot == -1) slot = player.GetActiveWeapon().GetSlot() for (local i = 0; i < SLOT_COUNT; i++) { local weapon = this.GetItemInSlot(player, i); if (weapon == null || weapon.GetSlot() != slot) continue; weapon.Kill(); break; } } CalculateCritFactor = function(attacker, victim) { if (victim.GetClassname() != "player") { victim = null } function IsMiniCritAttacker(entity) { local CritArray = [16, 19, 31] foreach(crit in CritArray) { if (entity.InCond(crit)) { return true } } return false } function IsMiniCritVictim(entity) { if (victim == null) return false local CritArray = [24, 30] foreach(crit in CritArray) { if (entity.InCond(crit)) { return true } } return false } function IsCritAttacker(entity) { local CritArray = [11, 34, 37, 39, 40, 44, 56] foreach(crit in CritArray) { if (entity.InCond(crit)) { return true } } return false } // Initialize the damage factor to 1.0 local factor = 1.0; // Check if the attacker is a crit attacker local isCritAttacker = IsCritAttacker(attacker); // Check if the attacker is a mini-crit attacker local isMiniCritAttacker = IsMiniCritAttacker(attacker); // Check if the victim is a mini-crit victim local isMiniCritVictim = IsMiniCritVictim(victim); // Determine the factor based on crit and mini-crit conditions if (isCritAttacker && isMiniCritVictim) { // If the attacker is a crit attacker and the victim is a mini-crit victim, crit overrides factor = 3.0; } else if (isCritAttacker) { // If the attacker is a crit attacker, crit factor factor = 3.0; } else if (isMiniCritAttacker) { // If the attacker is a mini-crit attacker, mini-crit factor factor = 1.35; } return factor; } GiveWeapon = function(player, className, itemID) { if (typeof itemID == "string" && className == "tf_wearable") { CTFBot.GenerateAndWearItem.call(player, itemID) return } local weapon = Entities.CreateByClassname(className) NetProps.SetPropInt(weapon, STRING_NETPROP_ITEMDEF, itemID) NetProps.SetPropBool(weapon, "m_AttributeManager.m_Item.m_bInitialized", true) NetProps.SetPropBool(weapon, "m_bValidatedAttachedEntity", true) weapon.SetTeam(player.GetTeam()) weapon.DispatchSpawn() // remove existing weapon in same slot for (local i = 0; i < SLOT_COUNT; i++) { local heldWeapon = NetProps.GetPropEntityArray(player, "m_hMyWeapons", i) if (heldWeapon == null || heldWeapon.GetSlot() != weapon.GetSlot()) continue heldWeapon.Destroy() NetProps.SetPropEntityArray(player, "m_hMyWeapons", null, i) break } player.Weapon_Equip(weapon) player.Weapon_Switch(weapon) // fixes bug where if a player is firing/reloading, the player has to switch weapons again to equip the weapon EntFireByHandle(gamerules, "RunScriptCode", "activator.Weapon_Switch(caller)", 0.1, player, weapon) return weapon } Clamp = function(value, min, max) { if (value < min) return min; if (value > max) return max; return value; } SoldierHelicopterSetup = function(ent) { local primary = GetItemInSlot(ent, 0) local secondary = GetItemInSlot(ent, 1) ent.ValidateScriptScope() local scope = ent.GetScriptScope() local ammo_max = 200 * primary.GetAttribute("maxammo primary increased", 1); EntFireByHandle(gamerules, "runscriptcode", "activator.Regenerate(true)", 0.15, ent, ent) ::HelicopterThink <- function() { // self is the weapon here local buttons = NetProps.GetPropInt(self, "m_nButtons"); local buttons_changed = buttons_last ^ buttons; local buttons_pressed = buttons_changed & buttons; local buttons_released = buttons_changed & (~buttons); local custom_wep = GetItemInSlot(self, 0); local cur_time = Time() local origin = self.GetOrigin() local index_primary = custom_wep.entindex(); // Define flying modes array local fly_modes = [ {mode = 0, will_fly = false, action = function(ent) { ent.SetMoveType(MOVETYPE_WALK, MOVECOLLIDE_DEFAULT); ent.RemoveCondEx(107, true); }}, // Not flying {mode = 1, will_fly = true, action = function(ent) { ent.SetMoveType(MOVETYPE_FLY, MOVECOLLIDE_DEFAULT); ent.AddCondEx(107, -1, null); }} // Flying mode ]; if (custom_wep != self.GetActiveWeapon()) { self.SetMoveType(MOVETYPE_WALK, MOVECOLLIDE_DEFAULT); self.RemoveCondEx(107, true) return -1 } else { fly_modes[is_flying].action(ent); } if (typeof(fire_wep) == "null") { fire_wep = 0; // Initialize zap hit time } if (typeof(sound_loop) == "null") { sound_loop = 0; // Initialize zap hit time } if (index_primary != ent_index) { // The player no longer has the weapon, stop thinking local scope = self.GetScriptScope(); NetProps.SetPropString(self, "m_iszScriptThinkFunction", ""); AddThinkToEnt(self, null); self.Regenerate(true); // need this if player is given weapons return -1; } function isWithinUpgradeStation() { for (local station; station = Entities.FindByClassname(station, "func_upgradestation");) { local mins = station.GetBoundingMins(); local maxs = station.GetBoundingMaxs(); local stationOrigin = station.GetOrigin(); if (origin.x >= (stationOrigin.x + mins.x) && origin.x <= (stationOrigin.x + maxs.x) && origin.y >= (stationOrigin.y + mins.y) && origin.y <= (stationOrigin.y + maxs.y) && origin.z >= (stationOrigin.z + mins.z) && origin.z <= (stationOrigin.z + maxs.z)) { return true; // Player is inside the station } } return false; // Default to false if not within any upgrade station } local is_instation = isWithinUpgradeStation() if (is_instation == true && weapon_mode == 1) { ClientPrint(self, 4, "Cannot use upgrade station while in Minigun mode!") EntFireByHandle(self, "RunScriptCode", "NetProps.SetPropBool(self, `m_Shared.m_bInUpgradeZone`, false);", -1, null, null); } //minigun logic local soundlevel = (40 + (20 * log10(3000 / 36.0))).tointeger() local damage = 30 local crit_mult = 1 local damage_bonus = custom_wep.GetAttribute("damage bonus", 1); local ammo_bonus = custom_wep.GetAttribute("maxammo primary increased", 1); local fire_rate_bonus = custom_wep.GetAttribute("fire rate bonus", 1); local primary_ammo_cur = NetProps.GetPropIntArray(self, "m_iAmmo", 1) local reload_state = NetProps.GetPropInt(custom_wep, "m_bInReload") local true_max_ammo = ammo_max_capacity * ammo_bonus self.AddCustomAttribute("max health additive penalty", -50, -1) local ammo_packs = { "item_ammopack_full" : 1, "item_ammopack_medium" : 0.5, "item_ammopack_small" : 0.2 }; // Initialize saved values if they have not been set if (typeof(saved_clip) == "null") saved_clip = -1; if (typeof(saved_reserve_ammo) == "null") saved_reserve_ammo = -1; // Check if we are in weapon mode for handling custom ammo logic if (weapon_mode == 1) { custom_wep.AddAttribute("mod max primary clip override", -1, -1); custom_wep.AddAttribute("override projectile type", 1, -1) // Loop through entities within a 25-unit radius for(local ent; ent = FindInSphere(ent, origin, 25);) { if (ent == null) { break } if (ent.GetClassname() in ammo_packs && check_if_ammo_pack == false) { check_if_ammo_pack = true // Calculate maximum ammo capacity local maximum_ammo_capacity = 200 * ammo_bonus //printl("ammo is:" + maximum_ammo_capacity) if (maximum_ammo_capacity == custom_wep.Clip1()) { continue } local ammo_mult = ammo_packs[ent.GetClassname()] // Calculate the amount to add based on the ammo multiplier local ammo_to_add = (maximum_ammo_capacity * ammo_mult) //printl("we must add ammo: "+ammo_to_add) // local clip_cur = NetProps.GetPropIntArray(custom_wep, "m_iClip1", 0); // //printl("our current clip is: "+clip_cur) local ammo_cur = NetProps.GetPropIntArray(self, "m_iAmmo", 1); //printl("our current ammo is: "+ammo_cur) // Calculate the new clip value local new_clip = ammo_cur + ammo_to_add //printl("math clip:" + new_clip) // // Ensure clip does not exceed maximum_ammo_capacity if (new_clip > maximum_ammo_capacity) { new_clip = maximum_ammo_capacity } // //printl("clip is now: " + new_clip) // Set the new clip value custom_wep.SetClip1(new_clip) // changes the actual clip NetProps.SetPropIntArray(self, "m_iAmmo", new_clip, 1) minigun_ammo = new_clip self.EmitSound("items/gift_pickup.wav") // Remove the ammo pack entity ammo_pack_array.append({classname = ent.GetClassname(), respawn_time = Time() + 10, origin = ent.GetOrigin() }); //PrintTable(ammo_pack_array) ent.Kill() break } } } foreach (pack in ammo_pack_array) { if ((pack.respawn_time) <= cur_time) { //printl("pack spawn") ammo_pack_array.remove(ammo_pack_array.find(pack)) //printl(pack.classname) // local new_pack = CreateByClassname(pack.classname) // DispatchSpawn(new_pack) // SetPropVector(new_pack, "origin", pack.origin) local new_pack = SpawnEntityFromTable(pack.classname, { targetname = "pack_new" origin = pack.origin }) } } // Weapon mode handling with right-click (IN_ATTACK2) if (buttons_pressed & IN_ATTACK2) { weapon_mode++; if (weapon_mode > 1) { weapon_mode = 0; custom_wep.RemoveAttribute("mod max primary clip override"); custom_wep.RemoveAttribute("override projectile type") NetProps.SetPropFloat(custom_wep, "m_flNextPrimaryAttack", cur_time + 0.5) // fix exploit with spamming rockets } if (saved_clip == -1 && saved_reserve_ammo == -1) { // Save current clip and reserve ammo values saved_clip = NetProps.GetPropIntArray(custom_wep, "m_iClip1", 0); saved_reserve_ammo = NetProps.GetPropIntArray(self, "m_iAmmo", 1); // Set weapon's ammo to minigun_ammo when in weapon mode NetProps.SetPropIntArray(custom_wep, "m_iClip1", minigun_ammo, 0); NetProps.SetPropIntArray(self, "m_iAmmo", minigun_ammo, 1); } else { // Restore saved clip and ammo reserve NetProps.SetPropIntArray(custom_wep, "m_iClip1", saved_clip, 0); NetProps.SetPropIntArray(self, "m_iAmmo", saved_reserve_ammo, 1); custom_wep.SetClip1(saved_clip) // changes the actual clip // Reset saved values to indicate no saved state saved_clip = -1; saved_reserve_ammo = -1; } } if (weapon_mode == 1) { custom_wep.AddAttribute("fire rate penalty", 999, -1); custom_wep.AddAttribute("provide on active", 1, -1); } else if (weapon_mode == 0) { custom_wep.RemoveAttribute("fire rate penalty") custom_wep.RemoveAttribute("provide on active"); } if (buttons & IN_ATTACK && (fire_wep + 0.1 * fire_rate_bonus) <= cur_time && weapon_mode == 1 && minigun_ammo > 0) { //custom_wep.RemoveAttribute("auto fires full clip") check_if_ammo_pack = false minigun_ammo--; NetProps.SetPropIntArray(self, "m_iAmmo", minigun_ammo, 1); // Update reserve ammo custom_wep.SetClip1(minigun_ammo) // changes the actual clip local eyepos_start = self.EyePosition() + self.EyeAngles().Forward() local eyepos_end = self.EyePosition() + self.EyeAngles().Forward() * 9999 fire_wep = cur_time if (isPlayingSound == false) { isPlayingSound = true EmitSoundEx ({ sound_name = "shooting_headshot.mp3", sound_level = soundlevel entity = self }); sound_loop = cur_time + 0.5 } else if ((sound_loop + 1.9) <= cur_time) { EmitSoundEx ({ sound_name = "shooting_headshot.mp3", sound_level = soundlevel entity = self delay = -0.5 }); sound_loop = cur_time } //shooting_headshot.mp3 local eyetrace = { start = eyepos_start, end = eyepos_end ignore = self mask = (CONTENTS_SOLID|CONTENTS_MOVEABLE|CONTENTS_WINDOW|CONTENTS_GRATE) } TraceLineEx(eyetrace) if (eyetrace.hit) { local hit_pos = eyetrace.pos local bullet_particle = SpawnEntityFromTable("info_particle_system", { effect_name = "bullet_tracer01", targetname = "bullet_tracer" origin = eyepos_start + Vector(0, 0, -25) angles = Vector(0, 0, 0) }) EntFireByHandle(bullet_particle, "SetParent", "!activator", -1, self, null) local dummy = SpawnEntityFromTable("prop_dynamic", { model = "models/empty.mdl", origin = hit_pos + Vector(RandomInt(-15, 15), RandomInt(-15, 15), RandomInt(-15, 15)) angles = Vector(0, 0, 0) disableshadows = 1 targetname = "warning" }) SetPropEntityArray(bullet_particle, "m_hControlPointEnts", dummy, 0) EntFireByHandle(bullet_particle, "Start", "", 0.1, null, null) EntFireByHandle(bullet_particle, "Stop", "", 0.2, null, null) EntFireByHandle(bullet_particle, "Kill", "", 0.3, null, null) EntFireByHandle(dummy, "Kill", "", 0.3, null, null) for(local ent; ent = FindInSphere(ent, hit_pos, 20);) { if (ent.GetClassname() in Damagable_Entities_List && ent.GetTeam() != self.GetTeam() && ent.GetTeam() != TEAM_SPECTATOR) { local crit_damage = CalculateCritFactor(self, ent) ent.TakeDamageEx(custom_wep, self, custom_wep, Vector(0, 0, 0), ent.GetOrigin(), damage * damage_bonus * crit_damage, TF_DMG_FALLOFF | TF_DMG_BULLET); break } else { continue } } } } else if (!(buttons & IN_ATTACK) || weapon_mode == 0) { isPlayingSound = false EmitSoundEx ({ sound_name = "shooting_headshot.mp3", sound_level = soundlevel entity = self flags = 4 }); } //flying logic // Get the player's current velocity local current_velocity = self.GetVelocity(); local fly_velocity = Vector(current_velocity.x, current_velocity.y, 0); // Start with current velocity, set Z to 0 local player_speed_upgrade = self.GetCustomAttribute("move speed bonus", 1) local speed_mult = 1 if (self.InCond(32)) { speed_mult = 1.35 } local fly_speed = 400 * player_speed_upgrade * speed_mult; // Adjust this value for the desired flying speed local upward_speed = 600 * player_speed_upgrade * speed_mult; // Vertical speed for going up/down local max_velocity = 600 * player_speed_upgrade * speed_mult; // Maximum velocity cap // Get current body direction local body_dir = self.GetAbsAngles(); // //printl(body_dir) local yaw = body_dir.y; // Only get the yaw component // Convert yaw to radians for trigonometric functions local yaw_rad = yaw * (PI / 180); // Calculate forward and left directions based on current yaw local forward_dir = Vector(cos(yaw_rad), sin(yaw_rad), 0); // Forward direction local left_dir = Vector(-sin(yaw_rad), cos(yaw_rad), 0); // Left direction // Toggle flying modes if (buttons_pressed & IN_ATTACK3) { // Cycle through modes is_flying = (is_flying + 1) % fly_modes.len(); fly_modes[is_flying].action(ent); is_flying_started = fly_modes[is_flying].will_fly; } // Reset fly_velocity local fly_velocity = Vector(0, 0, 0); // Define movement inputs and their actions local movement_inputs = [ {input = IN_FORWARD, action = function() { fly_velocity += forward_dir * fly_speed; }}, {input = IN_BACK, action = function() { fly_velocity -= forward_dir * fly_speed; }}, {input = IN_MOVELEFT, action = function() { fly_velocity += left_dir * fly_speed; }}, {input = IN_MOVERIGHT, action = function() { fly_velocity -= left_dir * fly_speed; }}, {input = IN_JUMP, action = function() { fly_velocity.z += upward_speed; }}, // Fly upwards {input = IN_DUCK, action = function() { fly_velocity.z -= upward_speed; }} // Fly downwards ]; // Iterate over movement inputs and execute relevant actions foreach (move in movement_inputs) { if (buttons & move.input) { move.action(); } } // Limit each component of the velocity to max_velocity fly_velocity.x = Clamp(fly_velocity.x, -max_velocity, max_velocity); fly_velocity.y = Clamp(fly_velocity.y, -max_velocity, max_velocity); fly_velocity.z = Clamp(fly_velocity.z, -max_velocity, max_velocity); // Apply the adjusted velocity to the player if (is_flying == 1) { self.SetVelocity(fly_velocity); } buttons_last = buttons; return -1 } // Initial setup scope.buttons_last <- 0 scope.is_flying_started <- false scope.is_flying <- 0 scope.fly_velocity <- Vector(0, 0, 0) scope.velocity_idle <- Vector(0, 0, 0) scope.Clamp <- Clamp scope.fire_wep <- 0 scope.sound_loop <- 0 scope.play_sound <- false scope.isPlayingSound <- false scope.minigun_ammo <- ammo_max scope.ammo_max_capacity <- 200 scope.weapon_mode <- 0 scope.saved_reserve_ammo <- null scope.saved_clip <- null scope.check_if_ammo_pack <- false scope.ammo_pack_array <- [] scope.CalculateCritFactor <- CalculateCritFactor scope.Damagable_Entities_List <- { "player" : 1, "obj_teleporter" : 1, "obj_sentrygun" : 1, "obj_dispenser" : 1, "tank_boss" : 1 } // Initialize the global attack tables list scope.PrintTable <- PrintTable scope.DoPrintTable <- DoPrintTable scope.GetItemInSlot <- GetItemInSlot scope.ent_index <- primary.entindex() scope.StripWeapon <- StripWeapon scope.GiveWeapon <- GiveWeapon scope.minigun <- null AddThinkToEnt(ent, "HelicopterThink") } OnGameEvent_player_spawn = function(params) { local player = GetPlayerFromUserID(params.userid) player.ValidateScriptScope() local playerscope = player.GetScriptScope() local primary = GetItemInSlot(player, 0) local weapon_id = NetProps.GetPropInt(primary, STRING_NETPROP_ITEMDEF) ////printl(primary) } OnGameEvent_post_inventory_application = function(params) { local player = GetPlayerFromUserID(params.userid) player.ValidateScriptScope() local playerscope = player.GetScriptScope() local primary = GetItemInSlot(player, 0) ////printl(primary) } OnScriptHook_OnTakeDamage = function(params) { local victim = params.const_entity local weapon = params.weapon local attacker = params.attacker local entity = params.inflictor local damage = params.damage local dmgtype = params.damage_type local dmg_special = params.damage_stats local weapon_id = NetProps.GetPropInt(weapon, STRING_NETPROP_ITEMDEF) attacker.ValidateScriptScope() local attacker_scope = attacker.GetScriptScope() local script_string = NetProps.GetPropString(attacker, "m_iszScriptThinkFunction") } }; __CollectGameEventCallbacks(HelicopterRL)