This will be possible easily in Update 9.0, until then it's only possible with some workarounds. On our discord in the channel #law-examples you'll find a example law. (discord.gg/eco)