replica:Write(action_name: string, ...: any): void
Server OnlyDynamic, name-based dispatch to the same Action implementations as replica.Actions. Intended for cases where the Action name is only known at runtime (a variable, config data, etc). Not type-checked against the Actions table -- an unknown name raises a runtime error.
Parameters
action_name*string | Name of the Action to invoke. |
...any | Arguments forwarded to the Action implementation. |
Returns
voidNo return value.
local actionName = config.OnPurchaseAction -- > // resolved at runtime
replica:Write(actionName, "Sword", 50)