Page 1 of 1

How to do If(region)

Posted: Mon Dec 19, 2011 3:23 am
by dragon slayer
How do i have a region check in the scripts

do i go by number like this

if(region = 5)
blah blah blah
else
blah
return;

or do i go by this
if(region = britain)
blah kill
else
blah love
return;

Posted: Mon Dec 19, 2011 4:11 am
by Xuri
For some reason the ID of the regions doesn't seem to be available to the region JS objects, so I think the only way would be to check against specific region-names. Example:

Code: Select all

var region = pUser.region;

if( region.name.toLowerCase() == "the town of Britain".toLowerCase() )
{
blah
}
else
{
blah
}
The .toLowerCase() bit is just there to make it not be case-sensitive, and can probably be removed if you'd rather just type in the exact names.

Posted: Mon Dec 19, 2011 5:10 am
by dragon slayer
thank you :) that helps a lot with what I'm working on i did region.name before and gae the region anew name i was like oops LOL

Posted: Mon Dec 19, 2011 4:06 pm
by Xuri
= assign value
== compare value
;)