ID:263790
 
Code:
mob
proc
menu_background(var/x1,var/y1,var/x2,var/y2)
for(var/xx = x1, xx <= x2, x++)
for(var/yy = y1, yy <= y2, y++)
var/obj/HUD/Background/M = new(client)
if(xx == x1)
M.icon_state = "left"
if(xx == x2)
M.icon_state = "right"
if(yy == y1)
M.icon_state = "lower"
if(yy == y2)
M.icon_state = "upper"
if(xx == x1 && yy == y1)
M.icon_state = "ll"
if(xx == x2 && yy == y2)
M.icon_state = "ur"
if(xx == x1 && yy == y2)
M.icon_state = "ul"
if(xx == x2 && yy == y1)
M.icon_state = "lr"
M.screen_loc = "[xx],[yy]"

obj
HUD
Background
icon = 'Menu.dmi'
New(client/C)
C.screen += src
layer = MOB_LAYER+2


Problem description:
In runtime I get an error saying atht it can not execute null.New(), and an infinite loop.

I'm not sure why you'd be seeing null.New() issues unless the infinite loop itself is to blame, but you do have two infinite loops. That should be xx++ and yy++ instead of x++ and y++.

Lummox JR
In response to Lummox JR
Now that I see it it looks so obvious. It's always the small things that I don't really take into account, thanks Lummox JR. :D