Welcome to the community!
For what you want to do, you'll have to go into the scripts (F11).
Do a search (CTRL + SHIFT + F) for "TIMEFLUTE".
Paste the red part underneath the time flute item handler. It should look like so:
Code:
ItemHandlers::UseOnPokemon.add(:TIMEFLUTE,proc{|item,pokemon,scene|
if !pokemon.isShadow?
scene.pbDisplay(_INTL("It won't have any effect."))
next false
end
pokemon.heartgauge=0
pbReadyToPurify(pokemon)
next true
})
[COLOR="Red"]# Opens or closes the heart of Pokemon
ItemHandlers::UseOnPokemon.add(:HEARTFLUTE,proc{|item,pokemon,scene|
if pokemon.isShadow?
pokemon.heartgauge=0
pokemon.pbPurify(pokemon,scene)
next false
end
pokemon.makeShadow
scene.pbDisplay(_INTL("{1}'s heart has been closed.",pokemon.name))
next true
})[/COLOR]
As you can probably tell, I named the item "Heart Flute."
In items.txt, paste this:
526,HEARTFLUTE,Heart Flute,Heart Flutes,1,0,"This item fully opens or closes the heart of Pokémon.",1,0,0
Don't forget to add an icon for the item as well.
Note: You may need to adjust the item's ID (mine is 526).
If you have any more questions on Shadow Pokemon, you should visit the Pokemon Essentials Wiki page on Shadow Pokemon.
Let me know if something didn't work for you or if you need any more help.