Depending on the settings you've picked, the cursor item should be the inventory graphic item anyway, so player.ActiveInventory would work?
Code: ags
function Girl_AnyClick()
{
if (player.ActiveInventory == iTeddyBear)
{
//some scripting
}
else
{
}
}