# Calls

## State Bags Instead of Events

For call-related functionality, we use **state bags** instead of events. State bags provide real-time synchronization across all clients and are more efficient for tracking call state.

**Please refer to the** [**State Bags documentation**](https://github.com/TeamsGG-Development/gitbook/blob/main/paid-scripts/phone/events/state-bags.md) **for call-related state bags:**

* `inCall` - Whether the player is currently in a call
* `callId` - The current call ID if player is in a call
* `callStatus` - Detailed call status information

### Why State Bags Instead of Events?

* **Real-time synchronization** - State bags automatically sync across all clients
* **Efficient** - No need to manually trigger events for every state change
* **Read-only tracking** - State bags are set automatically by the server

### Example Usage

```lua
-- Check if player is in a call
local player = Player(source)
if player.state.inCall then
    local callId = player.state.callId
    local callStatus = player.state.callStatus
    
    print("Player is in call:", callId)
    print("Call type:", callStatus.callType)
    print("Caller:", callStatus.callerNumber)
end
```

**For more information, see:** [State Bags Documentation](https://github.com/TeamsGG-Development/gitbook/blob/main/paid-scripts/phone/events/state-bags.md)
