-- LUA Script - precede every function and global member with lowercase name of script + '_main' -- Player Collects Health local lightattach = 6 -- change # 6 to your light entity # local decalattach = 5 -- change # 5 to your decal entity # function healthtest_init(e) HideLight(lightattach) Hide(decalattach) end function healthtest_main(e) PlayerDist = GetPlayerDistance(e) if PlayerDist < 350 and g_PlayerHealth > 0 then Show(decalattach) ShowLight(lightattach) end if PlayerDist < 50 and g_PlayerHealth > 0 then Hide(decalattach) HideLight(lightattach) Prompt("Collected health") PlaySound(e,0) AddPlayerHealth(e) Destroy(e) ActivateIfUsed(e) end end function healthtest_exit(e) end