I'm trying to make a quick script that adds a marker arrow to a unit when that unit uses a certain weapon, and removes it when the unit uses the weapon again. Unfortunately I'm a bit rusty. I've gotten this far:
But the error log complains:
As far as I can see, I've done nothing wrong - but I don't have much faith in my own analysis. Trying to attach the marker to the character, rather than the unit, had the same result.