Skip to content
View in the app

A better way to browse. Learn more.

LCPDFR.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How to Have Peds Perform Animations

Featured Replies

Hey I got a question about ped animations. How do I do them. I found two forum topics here on this very site but both are from pre-2020 and I'm not too sure if they still work as I'm getting errors using those templates.
Here's my code:


Thank you for any kind of help. I couldn't find anything on forums, YouTube, Google, or Reddit.
Note: I did have two other questions apart of this message but I found the answer.

FriendA = Ped.Tasks.PlayAnimation(AnimationDictionary, "amin@veh@apc@ds@base", "sit");
FriendB = Ped.Tasks.PlayAnimation(AnimationDictionary, "mb@medic@standing@kneel@base", "base");

I'm getting an error for Ped.Tasks and AnimationDictionary.
1. An object reference is required for the non-static field, method, or property 'Ped.Tasks
I couldn't find an API reference for this.

2. 'AnimationDictionary' is a type, which is not valid in the given context

I'm just overall confused about everything I'm supposed to put after PlayAnimation, the template was super confusing for me. If anyone use an example using one of the animations I picked, I hopefully can understand it better. Please and thank you for any future help.

Edited by lujerex
Edited out two questions as I found them out before anyone answered me.

londonrials | custom clothing & scripts

Could contain: pink, person, magenta, dress, dance, outdoor, girl, woman, purple

  • The title was changed to How to Have Peds Perform Animations

If you want a ped you have defined as 'FriendA' to perform an animation you need to use the function this way:

 

FriendA.Tasks.PlayAnimation("mp_facial", "mic_chatter", 3f, AnimationFlags.None);

 

The argument are the specific animation dictionary (in the above example: "mp_facial"), then the specific animation ("mic_chatter"), a float for speed, then any flag (in the format AnimationFlags.None or AnimationFlags.Loop, for example) 

 

Try Google for a list of dictionaries and animations, e.g. https://alexguirre.github.io/animations-list/ 

Edited by Ekalb

  • Author

Thank you! One more follow up question if you will, how to I stop an ongoing animation? I know in menus I can just do Stop Animation but obviously coding wise it has to be something different because Friend.Tasks.StopAnimation came invalid. So how would I stop it?

londonrials | custom clothing & scripts

Could contain: pink, person, magenta, dress, dance, outdoor, girl, woman, purple

  • Author
7 minutes ago, Ekalb said:

try FriendA.Tasks.Clear(); or  FriendA.tasks.ClearImmediately(); 

Okay, again thank you a lot! I'll make sure to include you in credits for assisting me. Take care.

londonrials | custom clothing & scripts

Could contain: pink, person, magenta, dress, dance, outdoor, girl, woman, purple

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Similar Content

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.