Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

To get around the `tool` requirement for executing functions from scripts, you can inject the `tool` keyword into the current script.

I use this pattern in a few of my plugins. It also makes developing plugins easier, as a nice side-effect :)

interesting idea to inject the keyword. but it also needs to be removed afterwards

Exactly what I was thinking.. How do you know when to remove it? If you inject it, users might not be aware of it and then weird stuff can happen

It's injected after the script is loaded, so it doesn't persist on disk.

This is easily verifiable by trying it on any script and observing that no changes are made to the actual file.

Oh ok that’s clever! Thanks for the anwser

It does not, the injection occurs after the script is loaded