Problem description:
I'm trying to set up a system in my code where it randomly spawns several different ore types on the map, a specific number of each, and once one has been mined another would spawn. My idea for implimentation of this was to make a world var representing each type then setting up a world proc that spawned the ores and repeatedly checked after to see if anyone had mined an ore(which would decriment the number of ores represented by a world var) and replace the ore and incriment the value again, but my problem is I can't figure out how to define a new world var, everytime I try it says "variable declaration not allowed here" I've tried searching all over the place for how to define a new world var but I've come up short, is this possible? If so how?
You may want to try something like this.
var That's just a little example of how you may want to set it up. |
You need a global var, not a "world var."
You could always just make it spawn a new ore at a random spot every time someone mines one, like this: