Eggerslolol Posted December 9, 2009 Share Posted December 9, 2009 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 More sharing options...
Eggerslolol Posted December 10, 2009 Author Share Posted December 10, 2009 Maybe do I need to make a new script on the spell instead of the jug? Link to comment Share on other sites More sharing options...
Eggerslolol Posted December 10, 2009 Author Share Posted December 10, 2009 Or could I make it target members of a specific faction? Link to comment Share on other sites More sharing options...
Eggerslolol Posted December 10, 2009 Author Share Posted December 10, 2009 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 More sharing options...
Recommended Posts