try AnimSync
This commit is contained in:
@@ -8,11 +8,24 @@ namespace ReallifeGamemode.Server.Util
|
||||
{
|
||||
public static class AnimationSync
|
||||
{
|
||||
public static void SyncAnimation(this Player player, dynamic animationName)
|
||||
public static void SyncAnimation(this Player player, dynamic animations)
|
||||
{
|
||||
if (!player.HasData("Animation"))
|
||||
player.SetData("Animation", String.Empty);
|
||||
|
||||
string animationName;
|
||||
|
||||
if (animations is List<string>)
|
||||
{
|
||||
animationName = animations.get(0);
|
||||
List<string> nextAnimations = animations.Skip(1);
|
||||
player.TriggerEvent("SERVER:QueueAnimations", nextAnimations.ToArray(), animationName);
|
||||
}
|
||||
else
|
||||
{
|
||||
animationName = animations;
|
||||
}
|
||||
|
||||
string currentAnimation = player.GetData<string>("Animation");
|
||||
string newAnimation = animationName;
|
||||
|
||||
@@ -52,9 +65,9 @@ namespace ReallifeGamemode.Server.Util
|
||||
public class AnimationSyncEvents : Script
|
||||
{
|
||||
[RemoteEvent("CLIENT:AnimPairTransition")]
|
||||
public void AnimPairTransition(Player player, Player target, string transitionTo)
|
||||
public void AnimPairTransition(Player player, string[] transitionTo)
|
||||
{
|
||||
target.SyncAnimation(transitionTo);
|
||||
player.SyncAnimation(transitionTo.ToList<string>());
|
||||
}
|
||||
|
||||
[RemoteEvent("CLIENT:ClearAnimationData")]
|
||||
|
||||
Reference in New Issue
Block a user