What about the monsters that spawn those skulls? Will they be generated by code? If not, the procedure is straight-forward: When you place a skull-spawning object in the scene manually, the name of that object is created automatically. Suppose you have a node called Monster in your scene; if you duplicate that monster manually, another one will be created with the name Monster2. If you duplicate that again, you will get a Monster3... I think you see where I am getting with this. You don't need to name everyting manually
Unfortunately, the object IDs change when a scene spawns again, so I don't think you can use those to keep track of the objects that have already spawned a skull. What is more, groups do not behave as expected when they are managed via code (which might be a bug). You could, however, use the unique names of the objects. ^^
The idea is that a skull spawning monster or chest should have a property which controls whether it can spawn a skull or not. This property should be a boolean variable set to true
by default.
Here's the tricky part: when a skull-spawning monster is slain, you register its unique name in a list in your global script. That way the program will crosscheck the list every time the same monster dies, and if both the boolean variable of that monster is set to true
AND its name is NOT in the list, then it will spawn a skull. If any of the above conditions is not satisfied, then said monster will NOT spawn a skull. Needless to say that you should save that list as a json file!
In other words, every skull-spawning object should check if its name is contained in the global list. If so, it will NOT spawn a skull. If it is the first time the player encounters that object, then it will spawn a skull, it will have its skull-spawning boolean variable set to false
and its unique name will be placed in the global list of "used" skull spawners for future reference.
That goes for when you place skull-spawning objects manually. If you do that via code, it is trickier. You would have to find a way to give every monster and chest a unique name every time it spawns, so that you can keep track of their names.
All in all, I think that for your purpose this system should work. If I have answered your question, please tell me so that I can update my answer.