eq2emu/docs/lua_functions/CastEntityCommand.md

24 lines
604 B
Markdown
Raw Permalink Normal View History

2025-05-25 21:42:32 -04:00
### Function: CastEntityCommand(caster, target, id, command)
2025-05-04 14:34:15 -04:00
**Description:**
2025-05-25 21:42:32 -04:00
Calls an Entity Command through LUA versus the player triggering it themselves.
2025-05-04 14:34:15 -04:00
**Parameters:**
2025-05-25 21:42:32 -04:00
- `caster` (Spawn) - Spawn object representing `caster`.
- `target` (Spawn) - Spawn object representing `target`.
- `id` (uint32) - Integer value `id`.
- `command` (string) - String `command`.
2025-05-04 14:34:15 -04:00
**Returns:** None.
**Example:**
```lua
2025-05-25 21:42:32 -04:00
-- From ItemScripts/AutomaticBook.lua
function obtained(Item, Spawn)
target = GetTarget(Spawn)
if target ~= nil then
-- CastEntityCommand(Spawn, target, 1, "Scribe")
end
2025-05-04 14:34:15 -04:00
```