Try if this works:package Test{ function CustomGameGui::clickAddOnItem() { parent::clickAddOnItem(); echo($ThisControl); }};activatePackage(Test);I believe $ThisControl is set before running the command on any gui control.