Jump to content

Recommended Posts

local robots = {"knight", "rook", "bishop"}for _, robot in pairs(robots) do	AddPrefabPostInit(robot, function(inst)		local old_set = inst.components.combat.SetTarget		inst.components.combat.SetTarget = function(self, target)			if target and target:HasTag("robotwhisperer") then				local enemytarget = target.components.combat.target				if not (enemytarget and enemytarget:HasTag("chess")) then					return				end			end			return old_set(self, target)		end	end)end

In modmain should make the tag work.

local robots = {"knight", "rook", "bishop"}for _, robot in pairs(robots) do	AddPrefabPostInit(robot, function(inst)		local old_set = inst.components.combat.SetTarget		inst.components.combat.SetTarget = function(self, target)			if target and target:HasTag("robotwhisperer") then				local enemytarget = target.components.combat.target				if not (enemytarget and enemytarget:HasTag("chess")) then					return				end			end			return old_set(self, target)		end	end)end

In modmain should make the tag work.

 

thanks!

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...