Vehicles/VehicleScripts/NetworkEvents/EventSetAnimatedPart.lua

This file contains an event that synchronizes the position of AnimatedParts.

  25  
  26  EventSetAnimatedPart                = EventSetAnimatedPart or ExtensionOf(BaseEvent);
  27  
  28  InitVanillaEvent(EventSetAnimatedPart, "EventSetAnimatedPart");
  29  
  30  function EventSetAnimatedPart:sendData(entity, key, value)
  31      streamWriteEntityId(entity);
  32      streamWriteUInt8(key);
  33      streamWriteBool(value);
  34  end;
  35  
  36  function EventSetAnimatedPart:receiveData(connection)
  37      local entity                    = streamReadEntityId();
  38      local key                       = streamReadUInt8();
  39      local value                     = streamReadBool();
  40  
  41      if entity ~= nil then
  42          entity:setAnimatedPartState(key, value, true);
  43      end;
  44      
  45      self:broadcastEvent(connection, entity, key, value);
  46  end;

All contents of this page may be used for modding use for Winter Resort Simulator - Season 2 only. Any use exceeding this regulation is not permitted.

Copyright (C) HR Innoways, 2021. All Rights Reserved.