Last active
August 29, 2015 14:09
-
-
Save CameronHall/c1e41b8e44b407f752d2 to your computer and use it in GitHub Desktop.
Speed/animationState camo selection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (isServer) then { | |
private ['_unit','_speed','_animationState','_animation','_limit','_texture']; | |
_unit = 'className'; //edit class name here | |
_animation = 'animationName'; //edit animation name here | |
_speedLimit = <5; // Speed limiter, CAN use operands and irrational numbers. | |
_texture = [0, "/pbo/texture.paa"]; //[hiddenselection, path] | |
if(typeOf _unit) then | |
{ | |
while {true} do | |
{ | |
_animationState = animationState _unit; | |
_speed = vectorMagnitude velocity _unit; | |
_speed = 3.6 * _speed; | |
uiSleep 0.5; | |
if (_speed _speedLimit && _animationState == _animation) then | |
{ | |
_unit setObjectTextureGlobal _texture; | |
}; | |
}; | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment