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

# GS2-AdReward スクリプト トリガー リファレンス

拡張スクリプトを呼び出すイベントトリガーのリファレンス



## トリガー

### acquirePoint

ポイント獲得
**関連するメソッド:**
acquirePointByUserId - ユーザーIDを指定してポイントを入手


#### 同期実行スクリプト

ポイント獲得処理の前に、スクリプトが同期実行されます。

##### Request

| | 型 | 説明 |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | ネームスペース |
| point | [Point](../sdk/#point) | 獲得処理前ポイント |
| acquirePointValue | long | 獲得ポイント量 |

##### Result

|  | 型 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- |
| permit | bool | ✓ |  |  | ポイント獲得を許可するか |
| overridePointValue | long |  |  | 0 ~ 2147483645 | 上書きする獲得ポイント量 |

##### 実装例


**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
}
```


#### 非同期実行スクリプト

ポイント獲得処理の後に、スクリプトが非同期実行されます。

##### Request

| | 型 | 説明 |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | ネームスペース |
| point | [Point](../sdk/#point) | 獲得処理前ポイント |
| afterPoint | [Point](../sdk/#point) | 獲得後ポイント |
| acquirePointValue | long | 獲得ポイント量 |


##### 実装例


**Lua**
```lua

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

-- 非同期スクリプトは通常、API のレスポンスには影響を与えません。
-- ログ出力や分析、外部通知などに使用します。

result = {
}
```


---
  
### consumePoint

ポイント消費
**関連するメソッド:**
consumePoint - ポイントを消費


#### 同期実行スクリプト

ポイント消費処理の前に、スクリプトが同期実行されます。

##### Request

| | 型 | 説明 |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | ネームスペース |
| point | [Point](../sdk/#point) | 消費処理前ポイント |
| consumePointValue | long | 消費ポイント量 |

##### Result

|  | 型 | 必須 | デフォルト | 値の制限 | 説明 |
| --- | --- | --- | --- | --- | --- |
| permit | bool | ✓ |  |  | ポイント消費を許可するか |
| overridePointValue | long |  |  | 0 ~ 2147483645 | 上書きする消費ポイント量 |

##### 実装例


**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
}
```


#### 非同期実行スクリプト

ポイント消費処理の後に、スクリプトが非同期実行されます。

##### Request

| | 型 | 説明 |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | ネームスペース |
| point | [Point](../sdk/#point) | 消費処理前ポイント |
| afterPoint | [Point](../sdk/#point) | 消費後ポイント |
| consumePointValue | long | 消費ポイント量 |


##### 実装例


**Lua**
```lua

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

-- 非同期スクリプトは通常、API のレスポンスには影響を与えません。
-- ログ出力や分析、外部通知などに使用します。

result = {
}
```


---
  



