void main() { if (GetTag(GetItemActivated()) == "tmfkeygen") { object oTarget = GetItemActivatedTarget(); if (!GetIsObjectValid(oTarget)) return; // Apply effects AssignCommand(oTarget, ClearAllActions()); CreateItemOnObject("tmfkey", oTarget); } }