ID:171860
 
Could someone gimmie a crash course in Global Vars? Like How do I modify them and do Checks and stuff. Its for an RP Mode.
A global var is like a normal var, except there is only one. If you have mob/var/global/X, X will be the same for all mobs.
In response to Garthor
so like usr.Roleplay = 1 would makle all Mobs in the world have THAT exact stat?
In response to Dixon
I'll give you a simple introduction.

To make a variable that'll goto the entire world (meaning there can only be one of that name, or you'll get variable name errors) do this:
var/Variable=0

That means the variable Variable is set to 0. You can simply change the variable as you would with any other variable, like so:
mob/verb/Change_Variable(N as num)
Variable=N

Simple, easy, efficient.
In response to JohnReaper
ok so how would I go about doing check? Like if Roleplay = 1 I want say to reach only those in view. So would I just do this?:

if(Roleplay == 1)
view(6) <<"Blah"
if(Roleplay == 0)
world <<"Blah"
In response to Dixon
u should read the bulletproof article by Garthor to see y wot u did is wrong.

and no i cant help on global vars if u wanna know.
In response to Dixon
Explain exactly what you want done, I think I have an idea.. You want a global variable that a RP admin or something can change, and you use a verb and if RP mode is enabled, it displays the text as RP? If not please elaborate and I will try to help.