ID:269427
 
How would I code it into the game so when someone uses a certain verb they gain a preset top icon?
obj
preset
icon = 'icon.dmi'
icon_state = "state"
pixel_y = 32
mob
verb
GetTopIcon()
if(!usr.topicon)
usr.overlays += /obj/preset
usr.topicon=1
return
else
usr.topicon=0
usr.overlays -= /obj/preset

mob
var
topicon = 0

like that >_>?
In response to Nintendo
In GetTopIcon(), you need to alter the value of topicon. Otherwise, it won't delete it when you press it a second time.
mob
verb
GetTopIcon()
if(!usr.topicon)
usr.overlays += /obj/preset
usr.topicon=1
return
else
usr.overlays -= /obj/preset
usr.topicon=0
In response to Dark Weasel
mah bad forgot xD, i was rushing x.x
In response to Dark Weasel
Or, for simplicity:
mob
verb
GetTopIcon()
topicon=!topicon
topicon?overlays+=/obj/preset:overlays-=/obj/preset