ID:2134570
 
(See the best response by Phat T.)
Code:
mob
player
var/is_male = 0

obj
sword
MouseEntered()
if (usr.is_male == 1)


Problem description:Under obj sword mouseentered I want to make and if statement, if the current player's var 'is_male' is 1 but the above gives undefined var...

Best response
Thats because user is just a mob and your var is for mob/player.
This should fix it...
mob
var/is_male=null


...or you can do it like this if you want just mob/players to have that var:
mob
player
var/is_male=null
obj
sword
MouseEntered()
var/mob/player/m = usr
if (m.is_male == 1)
gender

Is a thing, you know.

Also, don't use "== 1" to check if something is true. Instead, use:
if(varHere)