# Signals

Signals are a simple yet amazing feature. These have many use purposes in everyday code. The signal library is able to be accessed from `lib["signal"]`

### Creating a Signal

```lua
lib["signal"]["new"]()
```

### Firing a Signal

```lua
local signal = lib["signal"]["new"]()
signal:Fire(...) -- (...) would be the args you want to send to the signal
```

### Connecting to a Signal

```lua
local signal = lib["signal"]["new"]()
signal:Connect(function(callback)
    print(callback)
end)
```

### Example End Product

```lua
local signal = lib["signal"]["new"]()

signal:Connect(function(callback)
    print(callback)
end)

signal:Fire("hi")
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://panduh.gitbook.io/panduh-docs/getting-started/signals.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
