::HomingNamespace <- { Cleanup = function() { // cleanup any persistent changes here // keep this at the end delete ::HomingNamespace } // mandatory events OnGameEvent_recalculate_holidays = function(_) { if (GetRoundState() == 3) Cleanup() } OnGameEvent_mvm_wave_complete = function(_) { Cleanup() } // add stored variables or your own events here // // e.g. // myvar = 123 // // OnGameEvent_player_death = function(params) // { ... } gamerules = FindByClassname(null, "tf_gamerules") OnGameEvent_player_spawn = function(params) { local player = GetPlayerFromUserID(params.userid) local secondary = PopExtUtil.GetItemInSlot(player, 1) //printl(secondary) player.ValidateScriptScope() local playerscope = player.GetScriptScope() local wep_id = NetProps.GetPropInt(weapon, "m_AttributeManager.m_Item.m_iItemDefinitionIndex", itemID) } }; __CollectGameEventCallbacks(HomingNamespace)