GetPlayerInteraction: Difference between revisions
Jump to navigation
Jump to search
Document server-owned monsters and interactions |
Complete Lua function catalog |
||
| Line 32: | Line 32: | ||
* The action identifier can be used to distinguish consecutive interaction sessions. | * The action identifier can be used to distinguish consecutive interaction sessions. | ||
[[Category:Lua Functions]] | |||
[[Category:Server Functions]] | [[Category:Server Functions]] | ||
[[Category:Player Functions]] | [[Category:Player Functions]] | ||
[[Category:Interaction Functions]] | [[Category:Interaction Functions]] | ||
Latest revision as of 09:53, 15 August 2026
getPlayerInteraction
Returns the authoritative replicated interaction currently performed by a player.
Syntax
table|false getPlayerInteraction(int playerId)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
playerId |
int |
yes | The connected player identifier. |
Returns
Returns a table containing kind, active, actionId, and startedAtMs, or false for an invalid player or when no interaction state is available.
Examples
Inspect a player's current interaction:
local interaction = getPlayerInteraction(playerId)
if interaction and interaction.active then
outputDebugString("Player interaction: " .. interaction.kind)
end
Notes
- Available only in server-side resource scripts.
- Known interaction kinds currently include
generic,mining, andsitting. - The action identifier can be used to distinguish consecutive interaction sessions.