Rigmor Posted April 3, 2018 Share Posted April 3, 2018 I tried to use this code: Event OnTriggerEnter(ObjectReference akActionRef) If akActionRef == Game.GetPlayer() Game.GetPlayer().ModActorValue("health", 0) Else akActionRef.kill() EndIf EndEventI get the error kill is not a function. Is there a way so that npc's entering a trigger will be killed.I want them to "drown" in water, npc's that I don't want killed I successfully transport them back to the boat.Swimming actors I don't want alive, once they drift out behind the boat are killed. Link to comment Share on other sites More sharing options...
Evangela Posted April 3, 2018 Share Posted April 3, 2018 (akActionRef as Actor).kill() Link to comment Share on other sites More sharing options...
Rigmor Posted April 3, 2018 Author Share Posted April 3, 2018 (akActionRef as Actor).kill()Thank you so much Rasikko, kudos and a mention in the credits ;) Link to comment Share on other sites More sharing options...
candlepin Posted April 3, 2018 Share Posted April 3, 2018 I'm pretty sure Game.GetPlayer().ModActorValue("health", 0) will modify the player's health 0 points. Meaning it will do nothing to their health. I would change it slightly to Event OnTriggerEnter(ObjectReference akActionRef) If akActionRef == Game.GetPlayer() Float PlayerHealth = (Game.GetPlayer()).GetAV("health") (Game.GetPlayer()).ModActorValue("health", -PlayerHealth) Else (akActionRef as Actor).kill() EndIf EndEvent Link to comment Share on other sites More sharing options...
Rigmor Posted April 4, 2018 Author Share Posted April 4, 2018 Hey candlepin, thank you so much, it's not the player I want to kill, but the people in the water, if it does nothing to the players health, all the better. so it should go with the else if, and kill anyone that enters the trigger, and it does.If I dont kill the floaters, the other guys are wasting time trying to pin them with arrows from the deck and i need to release them from combat. If my guys get blown into the water, they have a package checks they're swimming, and if they are it moves them back onto the ship. I am pretty proud of that one :P Link to comment Share on other sites More sharing options...
candlepin Posted April 4, 2018 Share Posted April 4, 2018 If you're just trying to kill everyone but the player you can simplify the script to: Event OnTriggerEnter(ObjectReference akActionRef) If akActionRef != Game.GetPlayer() (akActionRef as Actor).kill() EndIfEndEvent Nothing else required. Link to comment Share on other sites More sharing options...
Rigmor Posted April 4, 2018 Author Share Posted April 4, 2018 If you're just trying to kill everyone but the player you can simplify the script to: Event OnTriggerEnter(ObjectReference akActionRef)If akActionRef != Game.GetPlayer()(akActionRef as Actor).kill()EndIfEndEvent Nothing else required.Fantastic, kudos and a mention for you sir o/compiled and in game. Link to comment Share on other sites More sharing options...
Recommended Posts