Jump to content

How do I make something attack enemies?


Eggerslolol

Recommended Posts

I've got the following script put on a jug:

 

 

float rechargeTimer

begin onActivate
if IsActionRef player ==1
	Activate
else
	set rechargeTimer to 0
endif
end

Begin gameMode

set rechargeTimer to rechargeTimer - getSecondsPassed
if rechargeTimer>0 || getDistance player>500
	return
endif
cast StandardShockDamageTarget1Novice player
set rechargeTimer to 10

end

 

 

Basically it shoots lightning at the player every 10 seconds, as long as he's within 500 units of the jug. The player can pick it up, move it, drop it, sell it, whatever. I just need to get this jug to attack enemies instead of the player. How would I go about doing this?

 

Sorry if this is a really stupid question, but I'm new to all this

Link to comment
Share on other sites

Got it working on individual enemies just by specifying them. I think I could get away with this since I will be controlling which enemies go for the player, but if there's anything gravely wrong with this please let me know:

 

scn JMStoneSCRIPT

float rechargeTimer

begin onActivate
if IsActionRef player ==1
	Activate
else
	set rechargeTimer to 0
endif
end



Begin gameMode

set rechargeTimer to rechargeTimer - getSecondsPassed
if rechargeTimer>0
	return
endif
if getDistance JMRat01<501 && JMRat01.GetDead!=1
cast StandardShockDamageTarget1Novice JMRat01

elseif getDistance JMRat02<501 && JMRat02.GetDead!=1
cast StandardShockDamageTarget1Novice JMRat02

endif
set rechargeTimer to 5
end

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...