I am supposing you have a coat rack with a cloak hanging on it (two separate objects). This can be accomplished without a global variable or global script. The following script is attached to the cloak hanging from the coat rack:
This script is attached to the coat rack. Since it references the cloak hanging on it that cloak needs to be marked references persist. For the purpose of this example the ID of the hanging cloak is aa_HangingCloak
These scripts have not been tested.
Begin aa_HangingCloak_Script if ( OnActivate == 1 ) ; must already be enabled or this would not be possible player->AddItem "aa_PE_cloak_a" 1 DisableendifEnd aa_HangingCloak_Script
This script is attached to the coat rack. Since it references the cloak hanging on it that cloak needs to be marked references persist. For the purpose of this example the ID of the hanging cloak is aa_HangingCloak
Begin aa_CoatRack_Script if ( OnActivate == 1 ) if ( ( player->GetItemCount "aa_PE_cloak_a" ) >= 1 ) player->RemoveItem "aa_PE_cloak_a" 1 "aa_HangingCloak"->Enable endIfendIf End aa_CoatRack_Script
These scripts have not been tested.
Thank you so much for your help cyran0, I'll give your scripts a try asap.