Ah, now I know what the error is. Because I am calling a function of a non tool script from a tool script.