[CS GO] Make a prop copy an animation
Posted: Mon Feb 05, 2018 9:52 am
Hello there! I'm trying to spawn an entity with player's model and make it copy player's animation. I tried to do this by using entity.set_parent but in this case the entity follows the player.
1) Is there way to copy parent animation without follow the parent?
2) How to give this entity a weapon (or model of weapon)?
1) Is there way to copy parent animation without follow the parent?
2) How to give this entity a weapon (or model of weapon)?
Syntax: Select all
from players.entity import Player
from entities.constants import EntityEffects
from engines.precache import Model
from commands.client import ClientCommand
def get_player_model_prop(player):
skin = Entity.create('prop_dynamic_override')
skin.model = player.model
skin.spawn_flags = 256
skin.set_property_uchar('m_CollisionGroup', 11)
skin.spawn()
skin.effects = EntityEffects.BONEMERGE | EntityEffects.NOSHADOW | EntityEffects.NORECEIVESHADOW | EntityEffects.PARENT_ANIMATES
skin.set_parent(player, -1)
skin.set_parent_attachment('primary')
return skin
@ClientCommand('create')
def _create(command, index, team_only=None):
player = Player(index)
my_model = get_player_model_prop(player)
my_model.origin = player.view_coordinates