Emotes
Synchronized player+NPC emotes, looping conversation gestures, and the money-handover reward animation. All functions are framework-agnostic pure-native wrappers.
StartConversationGestures(npcPed, skipNpc, skipPlayer) → functionclient
Starts looping idle-conversation gestures while a dialogue is open. Returns a stopper function — call it when dialogue closes.
| Param | Type | Description |
|---|---|---|
| npcPed | number | Entity handle of the NPC. |
| skipNpc | boolean | nil | If true, NPC plays no gestures. |
| skipPlayer | boolean | nil | If true, player plays no gestures. |
PlayShareEmote(emoteKey, npcPed, customEmotes)client
Plays a synchronized emote between player and NPC. emoteKey indexes into WCLibEmote.ShareEmotes or the optional customEmotes table.
| Param | Type | Description |
|---|---|---|
| emoteKey | string | Built-in keys: hug, handshake, hat_tip, wave_thanks, cheer, kneel_grateful. |
| npcPed | number | Entity handle of the NPC. |
| customEmotes | table | nil | Optional table of custom emote definitions to override built-ins. |
PlayFailEmote(emoteKey, npcPed, customEmotes)client
Plays an NPC fail-reaction emote.
| Param | Type | Description |
|---|---|---|
| emoteKey | string | Built-in keys: slap, push, cry_run, cry_turn, shoo, head_shake, frustrated_gesture, ignore. |
| npcPed | number | Entity handle of the NPC. |
| customEmotes | table | nil | Optional table of custom emote definitions to override built-ins. |
PlayRewardHandover(npcPed)client
Full blocking money-handover reward animation (~8 seconds). NPC spawns a bill prop on its hand and passes it to the player.
| Param | Type | Description |
|---|---|---|
| npcPed | number | Entity handle of the NPC performing the handover. |
example
-- Conversation gestures (returns a stopper)
local stop = wc:StartConversationGestures(npcPed)
Wait(5000)
stop()
-- Synchronized emote
wc:PlayShareEmote('handshake', npcPed)
-- Reward handover animation
wc:PlayRewardHandover(npcPed)
TriggerServerEvent('myResource:giveReward', rewardAmount)
Real Wild County example — stagecoach mission reward
wc_stagecoach/client/main.lua
wc:PlayRewardHandover(clerkPed) -- ~8s blocking animation
TriggerServerEvent('wc_stagecoach:missionComplete') -- server pays out AFTER the animation
Common mistakes
- Calling
WCLib.PlayShareEmote(...)from another resource —WCLibisn't visible outside wc_libs. Usewc:PlayShareEmote(...). - Triggering the server-side reward event before
PlayRewardHandoverfinishes — it's a blocking call (~8 seconds), so call it first, then trigger the payout, to keep the animation and the money in sync. - Forgetting
StartConversationGesturesreturns a stopper you must call — otherwise the idle chatter gestures keep looping after the conversation ends. - Passing an
emoteKeythat doesn't exist inShareEmotes/FailEmotesand not supplying acustomEmotestable — the call silently does nothing.
Troubleshooting
- If nothing happens on
PlayShareEmote/PlayFailEmote: check theemoteKeyspelling against the built-in keys listed above. - If the reward handover prop never appears: the bill prop model failed to load in time — this is rare, but the animation still plays without it.
- If gestures look off during your own custom dialogue system: this module assumes the player and NPC are already facing each other — call
FaceEachOtherfirst.