> For the complete documentation index, see [llms.txt](https://stigmax.gitbook.io/tfs-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://stigmax.gitbook.io/tfs-guide/interface-actions/actions-revscripts.md).

# Revscriptsys

### Script Structure

> **Constructor**:
>
> * *Action()*
>
> **Event**:
>
> * onUse(player, item, fromPosition, target, toPosition, isHotkey)
>
> **Methods**:
>
> * register(): Finalizes the definition of the action and registers it.
> * id(itemId\[, itemIds...]):
> * > itemId \[Required]: Item id to register the event to.
>   >
>   > itemIds \[Optional]: All extra item ids to register.
> * aid(actionId\[, actionIds]): Follows the same behavior as the `id(itemId[, itemIds...])` method.
> * uid(uniqueId\[, uniqueIds]): Follows the same behavior as the `id(itemId[, itemIds...])` method.
> * allowFarUse(bool):&#x20;
> * > bool: Accepts true/false values, same behavior as `allowfaruse` in XML.
> * blockWalls(bool):
> * > bool: Accepts true/false values, same behavior as `blockwalls` in XML.
> * checkFloor(bool):
> * > bool: Accepts true/false values, same behavior as `checkfloor` in XML.

### Example

```lua
-- data/scripts/change_gold.lua
local action = Action()

action:id(2148)

function action.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if player:getName() == "Delusion" then
        item:transform(2160)
        return true
    end
    return false
end

action:register()
```
