CyberM.animations.current(entity)
The clip a body is currently playing.
Returns false when it is playing nothing — which is a state, not an error.
Returns
- clip name, or false
- reason, when applicable
Registered in ResourceHost.cpp as LuaAnimationCurrent (line 6591).
CyberM.animations.play(entity, animation)
Plays a named animation on a body.
Does not work on the local player: their body cannot hold a workspot. Use CyberM.animations.playSelf for that, which stands a double in for them.
Parameters
- entityentityrequired
- animationstringrequired
Returns
- true on success, otherwise false
- reason for the refusal
Example
local ok, reason = CyberM.animations.play(entityId, "emote_smoke")
if not ok then print("refused: " .. reason) end
Registered in ResourceHost.cpp as LuaAnimationPlay (line 6587).
CyberM.animations.playSelf(animation, [thirdPerson])
Plays an emote on the local player, through a stand-in body.
The player's own body cannot hold a workspot, so an invisible double takes their place for the length of the clip. This is a separate call rather than play with the player's id because the mechanism is genuinely different.
Parameters
- animationstringrequired
- thirdPersonbooleanoptional
Returns
- true on success, otherwise false
- reason for the refusal
Registered in ResourceHost.cpp as LuaSelfEmotePlay (line 6588).
CyberM.animations.stop(entity)
Stops whatever a body is playing and releases what was set up for it.
Stops the workspot animation currently managed by CyberM for the selected body and releases its native animation state. It does not claim or stop arbitrary game animations that CyberM does not own.
Returns
- true on success, otherwise false
- reason for the refusal
Registered in ResourceHost.cpp as LuaAnimationStop (line 6590).
CyberM.animations.stopSelf()
Stops the local player's emote and removes the stand-in.
Ends the local-player emote created by playSelf and removes its stand-in body. Cleanup is idempotent and is also performed when the owning resource generation stops.
Returns
- true on success, otherwise false
- reason for the refusal
Registered in ResourceHost.cpp as LuaSelfEmoteStop (line 6589).