Script to trigger an animation in nearby peds
-
Hello. Can someone please send a script that will make all nearby peds play animation X when I press lets say T button on a keyboard? Thank you
-
https://forums.gta5-mods.com/topic/21370/a-script-to-trigger-a-specific-animation-in-nearby-peds
https://forums.gta5-mods.com/topic/36158/c-how-to-get-a-closest-ped-with-an-parameters-help-pls
-
@JohnFromGWN I've tried this one:
using GTA;
using GTA.Math;
using GTA.Native;
using System;
using System.IO;
using System.Windows.Forms;public class AnimMod : Script
{
public AnimMod()
{
KeyDown += AnimMod_KeyDown;
}private void AnimMod_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.E) { Native.Function.Call(Native.Hash.REQUEST_ANIM_DICT, "missprologueig_1"); Wait(50); Ped[] NearbyPeds = World.GetNearbyPeds(Game.Player.Character, 20f); foreach (Ped p in NearbyPeds) { p.Task.ClearAllTasks(); p.Task.PlayAnimation(p, "idle_loop_malehostage02", "missprologueig_1", 8.0, 8.0 * -1, -1, 0, 0, false, false, false); } } }
}
it doesn't work
-
Here this is code I use and definitely works with SHVDN 3
private void AllPedsDance(object sender, EventArgs e) { Ped[] all_ped = World.GetAllPeds(); foreach (Ped SpawnedPed in all_ped) { SpawnedPed.Task.PlayAnimation("mini@strip_club@private_dance@part2", "priv_dance_p2", 8f, -1, AnimationFlags.Loop); } }
-
@chickentooth here is a working example.
-
@JohnFromGWN said in Script to trigger an animation in nearby peds:
SHVDN 3
Do I put that code into visualbase studio and compile cs file? Could you please send the whole code for this or just already working script with that code? Thank you
-
This post is deleted!