GetPlayerInteraction

From Wiki G1R-MP G1 Remake Multiplayer
Revision as of 04:25, 14 August 2026 by QCherry (talk | contribs) (Document server-owned monsters and interactions)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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, and sitting.
  • The action identifier can be used to distinguish consecutive interaction sessions.