You most likely attempted to initialize an instance of any OSBot class outside the methods defined in the Script class, eg:
@ScriptManifest(name = "Lol", author = "Token", version = 1.0, info = "", logo = "")
public class Lol extends Script {
NPC x = npcs.closest("Guard"); // script won't start because of this
NPC y;
@Override
public void onStart() throws InterruptedException {
// something
y = npcs.closest("Guard"); // but this is fine
}
@Override
public int onLoop() throws InterruptedException {
// something
return 69;
}
}
Post your code if that's not the case because this is definitely a programming error