IsPlayerMining: Difference between revisions
Jump to navigation
Jump to search
Document server-owned monsters and interactions |
Complete Lua function catalog |
||
| Line 30: | Line 30: | ||
* Use the mining events for edge-triggered gameplay and this function for state queries. | * Use the mining events for edge-triggered gameplay and this function for state queries. | ||
[[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:54, 15 August 2026
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.