❔ Random numberGen Error
Trying to make a random number generator, and I keep getting this error:
"A field initializer cannot reference the non-static field, method, or property 'combat.numberGen'"
![](https://utfs.io/f/f29bdce2-64a6-4227-82d8-f06c5b2c33b8-1nq2cb.png)
5 Replies
access modifiers aren't valid inside a method
Okay, so how can I re-arrange the code so it works?
Remove access modifiers
From the local variables, that is
delete public keywords in counter() method
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.