Difference between revisions of "ForceHackIngredient"

From Nomad DB
(Created page with "Hacks the specified hackable entity. Said entity doesn't have to be visible to the player or have a "Hack" interaction prompt, as long as it has a Hacking Component. == Synta...")
 
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
Hacks the specified hackable entity. Said entity doesn't have to be visible to the player or have a "Hack" interaction prompt, as long as it has a Hacking Component.
+
{{Page_WD2}}
 +
Hacks the specified hackable entity (entities that have a ''CHackingComponent'').
  
 
== Syntax ==
 
== Syntax ==
Line 9: Line 10:
  
 
== Example ==
 
== Example ==
Spawns and hacks the Spider Tank.
+
Spawns the spider drone and hacks it to take control over the drone.
 
<syntaxhighlight lang="lua">
 
<syntaxhighlight lang="lua">
local spidertank = SpawnEntityFromArchetype("{a0b8ae08-00fc-4458-9fcd-f70dc6ba6b7e}", 0, 0, 65, 0, 0, 0)
+
local spiderDrone = SpawnEntityFromArchetype("{a0b8ae08-00fc-4458-9fcd-f70dc6ba6b7e}", 0, 0, 0, 0, 0, 0)
ForceHackIngredient(spidertank, GetLocalPlayerEntityId())
+
ForceHackIngredient(spiderDrone, GetLocalPlayerEntityId())
 
</syntaxhighlight>
 
</syntaxhighlight>
  

Latest revision as of 20:40, 27 October 2020

Hacks the specified hackable entity (entities that have a CHackingComponent).

Syntax

ForceHackIngredient(targetEntityId, hackerEntityId)
  • targetEntityId (string): ID of the entity to be hacked
  • hackerEntityId (string): ID of the hacking entity

Example

Spawns the spider drone and hacks it to take control over the drone.

local spiderDrone = SpawnEntityFromArchetype("{a0b8ae08-00fc-4458-9fcd-f70dc6ba6b7e}", 0, 0, 0, 0, 0, 0)
ForceHackIngredient(spiderDrone, GetLocalPlayerEntityId())

Related Pages