Emotes Menu

Exports

Client and server exports to play emotes, walk styles and moods from your own resources

Exports

suty-emotes exposes exports so your other resources can play emotes, read the player's state or set a walk style. Most of them are client-side: call them from your own client scripts.

Call the client exports from code that is allowed to wait — inside CreateThread, a command or an event handler. Some of them load the animation before they return.

Emote names are the /e names shown on the right of every row in the menu.


Emotes (client)

-- Play an emote by name ('c' or 'cancel' stops the current one)
exports['suty-emotes']:EmoteCommandStart('dance')

-- Stop the current emote
exports['suty-emotes']:EmoteCancel()

-- true while an emote is playing
local busy = exports['suty-emotes']:IsPlayerInAnim()     -- IsInEmote() returns the same

-- Name of the emote playing right now, or nil
local current = exports['suty-emotes']:GetCurrentEmote()

Walk styles (client)

exports['suty-emotes']:SetWalkStyle('Gangster')      -- name from the walk styles list
exports['suty-emotes']:ResetWalkStyle()              -- back to the normal walk
local walk = exports['suty-emotes']:GetCurrentWalk() -- current walk style name, or nil

With Config.PersistentWalk = true a style set by export is saved like one picked in the menu.

Moods (client)

exports['suty-emotes']:SetExpression('Angry')               -- name from the moods list
exports['suty-emotes']:ResetExpression()                    -- back to the normal face
local mood = exports['suty-emotes']:GetCurrentExpression()  -- current mood name, or nil

-- Pause the mood for 5 seconds so your own script can play a facial animation
exports['suty-emotes']:SuspendExpression(5000)

The chosen mood is re-applied every half second. If your script plays its own facial animation (brushing teeth, smoking…), call SuspendExpression(ms) first so the mood doesn't override it.

Shared emotes (client)

-- Send a shared emote request to a player (server id). They must be within 3 m.
exports['suty-emotes']:RequestSharedEmote('hug', targetServerId)

-- true while the player is in a shared emote
local inShared = exports['suty-emotes']:IsInSharedEmote()

-- Stop the shared emote for both players
exports['suty-emotes']:CancelSharedEmote()

Hands up, pointing, crouch, crawl, ragdoll (client)

These work even when the matching key is turned off in config.lua, so you can drive them from your own script.

-- Hands up
exports['suty-emotes']:ToggleHandsup()
local handsUp = exports['suty-emotes']:IsPlayerInHandsUp()

-- Pointing
exports['suty-emotes']:TogglePointing()
exports['suty-emotes']:StartPointing()
exports['suty-emotes']:StopPointing()
local pointing = exports['suty-emotes']:IsPointing()

-- Crouch / crawl
exports['suty-emotes']:ToggleCrouch()
exports['suty-emotes']:ToggleCrawl()
local crouching = exports['suty-emotes']:IsCrouching()
local crawling  = exports['suty-emotes']:IsCrawling()

-- Ragdoll
exports['suty-emotes']:ToggleRagdoll()
exports['suty-emotes']:StartRagdoll()
exports['suty-emotes']:StopRagdoll()
local down = exports['suty-emotes']:IsRagdolling()

Shared emote without a request (server)

-- Starts a shared emote on two players right away, no accept card.
-- initiatorId and targetId are server ids; the emote name comes from the shared list.
exports['suty-emotes']:ForceSharedEmote(initiatorId, targetId, 'hug')

Useful for scripted interactions (police, medics, jobs) where both players already agreed in your own flow.


Compatibility event (client)

Scripts written for the classic emote menus play emotes with this event. suty-emotes listens to it, so consumable and job scripts keep working:

-- from a client script
TriggerEvent('animations:client:EmoteCommandStart', { 'drink' })
TriggerEvent('animations:client:EmoteCommandStart', { 'c' })   -- cancel

-- from a server script
TriggerClientEvent('animations:client:EmoteCommandStart', source, { 'drink' })

Scripts that call exports['rpemotes'] or exports['dpemotes'] directly won't find suty-emotes. Change them to exports['suty-emotes']:EmoteCommandStart(...), or use the event above.

Merry Christmas.

From Suty.