IsPlayerMining
Jump to navigation
Jump to search
isPlayerMining
Checks whether a player is currently performing the replicated mining interaction.
Syntax
bool isPlayerMining(int playerId)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
playerId |
int |
yes | The connected player identifier. |
Returns
Returns true only while the player's active interaction kind is mining; otherwise returns false.
Examples
Award ore when a mining cycle completes:
addEventHandler("onPlayerMiningStop", root, function(playerId)
givePlayerItem(playerId, "ore", 1)
end)
Notes
- Available only in server-side resource scripts.
- Use the mining events for edge-triggered gameplay and this function for state queries.