mob/var/AFK
var/obj/AfkIcon/AfkIcon=new
obj/AfkIcon
pixel_x=8
pixel_y=8
icon='Other.dmi'
icon_state="AFK"
layer=FLOAT_LAYER
mob/proc/CheckAFK()
if(src.client.inactivity>=20) if(!src.AFK)
src.AFK=1
src.overlays-=AfkIcon
src.overlays+=AfkIcon
else if(src.AFK)
src.AFK=0
src.overlays-=AfkIcon
Problem description: MY FRIEND DECIDED TO MAKE A AFK SYSTEM AND I HELPED HE BUT IT DONT WORK. CAN SOMEBODY TELL ME WHATS WRONG HERE? WHY THE CHARACTER AFTER 20 SEC DONT APPARE THE AFK ICON ON HIS ICON?
As for the procedure: you need to create a loop in order for it to constantly check the client's inactivity. As it stands, it'll only do CheckAFK() once.