---
name: "lightIsOn"
type: command
status: ok
groups: ["Lights"]
arma3_since: "0.50"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/lightIsOn
revid: 369182
updated: 2024-09-03T10:34:45Z
---

# lightIsOn

*Command · Lights · Arma 3 v0.50 · introduced in Operation Flashpoint v1.04*

## Description

Check if lampost is on (shining).

> [!NOTE]
> A lamp state is **local** to each client (see [switchLight](../commands/switchLight.md)).

> [!NOTE]
> This command was originally designed to only work with CfgNonAIVehicles class "StreetLamp" only;
> since Arma 3 v1.92 this command was extended to work with street lights.

## Syntax

```sqf
lightIsOn lamppost
```

**Parameters:**

- `lamppost`: [Object](../topics/Object.md)

**Returns:** [String](../topics/String.md) - can be one of:
- **"ON"** - light is on
- **"OFF"** - light is off
- **"AUTO"** - applicable only to the light of type "StreetLamp" and is only on during the night.
- **"ERROR"** - if command fails

## Examples

### Example 1

```sqf
if (lightIsOn nearestObject [player, "StreetLamp"] == "ON") then { hint "nightime"; };
```

### Example 2

```sqf
_it = lightIsOn object 159582;
```

### Example 3

```sqf
if (count allMissionObjects "StreetLamp" == 0) then {
    hint "Objects compatible with 'lightIsOn' are not found.";
} else {
    hint "'lightIsOn' compatible objects are found!";
};
```

## See also

[switchLight](../commands/switchLight.md)

<sub>Source: [BI Community Wiki — lightIsOn](https://community.bistudio.com/wiki/lightIsOn) (revision 369182).</sub>
