ID:143375
 
Code:
world
mob = /mob/player
view = 5




mob
player
icon = 'player.dmi'
var
xp = 0
int = 100
rank = "Ensign"
Stat()
..()
statpanel("Stats")
stat("Intel","[int]")


verb
say(msg as text)
world << "[src.rank] [usr]: \"[msg]\""


//login info //
Login()
Move(locate(53,2,1))
src <<""
src <<""
sleep(100)
src <<""
src << "Welcome to the NX project [src.rank]."
src <<""






obj
comp1
name = "Main Computer"
icon = 'comp1.dmi'
density = 1
verb
History_of_Warp()
set src in oview(1)
usr <<"good"

comp2
name = "Coolant Studies"
icon = 'comp2.dmi'
density = 1
verb
Work_on_Project()
set src in oview(1)
if([src.int] >= 5)// ERROR
usr << "good"


Problem description:

the error is at the end of this code and says that int is an undefined var. I am not sure what im missing. please help.
Remove the brackets from src.int.
In response to Popisfizzy
Popisfizzy wrote:
Remove the brackets from src.int.

yes ive tried this, but it still gives me an undefined var error.
In response to Treasurecat
Ah, I was looking at it wrong. src would refer to the obj. This is a verb, so it's usr-safe (take not that usr is only ever safe in verbs; don't use it in a proc), so change that to usr.int.
In response to Popisfizzy
Popisfizzy wrote:
Ah, I was looking at it wrong. src would refer to the obj. This is a verb, so it's usr-safe (take not that usr is only ever safe in verbs; don't use it in a proc), so change that to usr.int.

yes tried that too, and still same error. I am figuring that im messing up because this code is calling for a global var when this is a usr/var. Not too sure what I need to fix that though if thats the problem.
In response to Treasurecat
Try defining int under /mob isntead of /mob/player.
In response to Popisfizzy
Popisfizzy wrote:
Try defining int under /mob isntead of /mob/player.

thats it, thank you.
In response to Treasurecat
couldn't you typecast, THEN check for the int?
var/mob/player/P=usr
if(P.int)