ID:1378369
 
Code:
    slotmode
mouse_opacity = 1
icon = 'buttons.dmi'
icon_state = "slot"
New(client/c)
screen_loc="2,3"
c.screen+=src
Click()
set src in usr.client.screen
usr << "<font=yellow><b>You are now in slot mode.</b></font>"
usr.mousemode = "slot"
interactmode
mouse_opacity = 1
icon = 'buttons.dmi'
icon_state = "interact"
New(client/c)
screen_loc="1,3"
c.screen+=src
Click()
set src in usr.client.screen
usr << "<font=yellow><b>You are now in slot mode.</b></font>"
usr.mousemode = "slot"


mob/proc
updateHealth()
var/percent=round(src.HP.value/src.HP.max*100,5)
if(percent>100) percent=100
if(percent<0) percent=0
for(var/obj/hudMeters/health/o in src.client.screen)
o.icon_state="[num2text(percent)]"
spawn(10)
src.updateHealth()
updateMana()
var/percent=round(src.MP.value/src.MP.max*100,5)
if(percent>100) percent=100
if(percent<0) percent=0
for(var/obj/hudMeters/mana/o in src.client.screen)
o.icon_state="[num2text(percent)]"
spawn(10)
src.updateMana()


Problem description:

When I click on my "slotmode" or "interactmode" buttons, I receive this runtime error:

runtime error: Cannot read null.screen
proc name: updateHealth (/mob/proc/updateHealth)
usr: GamerMania (/mob)
src: GamerMania (/mob)
call stack:
GamerMania (/mob): updateHealth()
GamerMania (/mob): updateHealth()
runtime error: Cannot read null.screen
proc name: updateMana (/mob/proc/updateMana)
usr: GamerMania (/mob)
src: GamerMania (/mob)
call stack:
GamerMania (/mob): updateMana()
GamerMania (/mob): updateMana()
You have updateMana() and updateHealth() running for mobs that aren't connected to a client, which is generating the error "null.screen".

Also, you don't really need to do set src in usr.client.screen under Click(). Unless you have some ulterior motive that I am oblivious to.
No, the Update() procs aren't running for anyone else. The only time I call it is in Login()
The null.screen error means that it can't read the client. Which means that somewhere, your client/mob relationship has changed.