> For the complete documentation index, see [llms.txt](/llms.txt)

# GS2-AdReward Script Trigger Reference

Reference for event triggers that call extended scripts



## Trigger

### acquirePoint

Point acquisition

**Related methods:**
acquirePointByUserId - Acquire Point by User ID


#### Synchronous Execution Script

The script is executed synchronously before the point acquisition process.

##### Request

| | Type | Description |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | Namespace |
| point | [Point](../sdk/#point) | Point before acquisition |
| acquirePointValue | long | Amount of points to be acquired |

##### Result

|  | Type | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- |
| permit | bool | ✓ |  |  | Whether to allow point acquisition |
| overridePointValue | long |  |  | 0 ~ 2147483645 | Point amount used to override the acquired point value |

##### Implementation Example


**Lua**
```lua

-- Request
local namespace = args.namespace
local point = args.point
local acquirePointValue = args.acquirePointValue

-- Business logic:
local permit = true
local overridePointValue = 0

-- Result
result = {
  permit=permit,
  overridePointValue=overridePointValue
}
```


#### Asynchronous Execution Script

The script is executed asynchronously after the point acquisition process.

##### Request

| | Type | Description |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | Namespace |
| point | [Point](../sdk/#point) | Point before acquisition |
| afterPoint | [Point](../sdk/#point) | Point after acquisition |
| acquirePointValue | long | Amount of points to be acquired |


##### Implementation Example


**Lua**
```lua

-- Request
local namespace = args.namespace
local point = args.point
local afterPoint = args.afterPoint
local acquirePointValue = args.acquirePointValue

-- Asynchronous scripts typically do not affect the API response.
-- These scripts are typically used for logging, analytics, external notifications, and similar purposes.

result = {
}
```


---
  
### consumePoint

Point consumption

**Related methods:**
consumePoint - Consume Points


#### Synchronous Execution Script

The script is executed synchronously before the point consumption process.

##### Request

| | Type | Description |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | Namespace |
| point | [Point](../sdk/#point) | Point before consumption |
| consumePointValue | long | Amount of points to be consumed |

##### Result

|  | Type | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- |
| permit | bool | ✓ |  |  | Whether to allow point consumption |
| overridePointValue | long |  |  | 0 ~ 2147483645 | Point amount used to override the consumed point value |

##### Implementation Example


**Lua**
```lua

-- Request
local namespace = args.namespace
local point = args.point
local consumePointValue = args.consumePointValue

-- Business logic:
local permit = true
local overridePointValue = 0

-- Result
result = {
  permit=permit,
  overridePointValue=overridePointValue
}
```


#### Asynchronous Execution Script

The script is executed asynchronously after the point consumption process.

##### Request

| | Type | Description |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | Namespace |
| point | [Point](../sdk/#point) | Point before consumption |
| afterPoint | [Point](../sdk/#point) | Point after consumption |
| consumePointValue | long | Amount of points to be consumed |


##### Implementation Example


**Lua**
```lua

-- Request
local namespace = args.namespace
local point = args.point
local afterPoint = args.afterPoint
local consumePointValue = args.consumePointValue

-- Asynchronous scripts typically do not affect the API response.
-- These scripts are typically used for logging, analytics, external notifications, and similar purposes.

result = {
}
```


---
  



