ID:165750
 
Is it possible to make one global veriable that every person will use? It will really come in handy when I'm minipulating some of my lists in-game. Most of my Admin system doesn't work correctly because the lists for who's an admin and who's not have different values for different people. I just want to have one list that is accessable to everyone, but when the values are changed, they're changed for everyone. Is this possible? And if so, can I have a small example?
var
mob
hp=100


I'm tired, but thats how you make a global variable for a mob
In response to KirbyAllStar
That's not exactly what I mean. Sure, that will create a varible for a mob, but if it's changed for ONE mob, like if ONE person get's hit by an attack, not everyone else has to pay the price for it. I want it so that if something is removed or added in a list for one mob, it's changed accordingly for every other player mob in the world.
In response to KirbyRules
That's what KirbyAllStar showed, note at where the 'var' is located

var/mob/M  //global-var
mob/var/mob/M //mob-var
global/var/mob/M //see first point


So let's say I want to define the maximum health everyone can get:
var/Max_HP = 100
//Or better yet, let's use #define
#define Max_HP = 100


- GhostAnime
In response to KirbyAllStar
Kirby Dude Fellow, that doesn't make sense, you're creating a reference for a mob, called hp, set to 100? D:
In response to DivineO'peanut
Like I said I'm tired, I know it doesn't make since but I couldn't think of a better example at the time.
In response to GhostAnime
GhostAnime wrote:
> global/var/mob/M  //see first point

I'll have to add that in for the next update, 'cause I don't have enough bugtesters to test this out completely. (Also, I got errors when I tried it that way, so I put global after var, and it didn't give any compile errors.)