Script help with a condition please.

Post » Sat Dec 27, 2014 12:03 pm

I have a script which is activated on a kind of Doomstone. This script is just a visual thing. Basically it creates a small explosion when player activates it like this...

Explosion Property myExp AutoObjectReference Property myMarker AutoPerk Property MyPerk AutoEvent OnActivate(ObjectReference akActionRef)If akActionRef == Game.GetPlayer()myMarker.PlaceAtMe(myExp)EndIfEndEvent

All is good except the explosion happens all the time regardless if the player already has the perk. I've already added a Perk Property but am unsure how to script a condition line that checks that the player doesn't have the perk and so the explosion happens and it doesn't if the player has the perk. I know the "positive check" I can add like this...

If (Game.GetPlayer().HasPerk(MyPerk))

But how do I make it negative such as If the player doesn't have this perk then EXPLODE. I am sure there is a better way to script this and am open to all suggestions. Thanks.

User avatar
Sarah MacLeod
 
Posts: 3422
Joined: Tue Nov 07, 2006 1:39 am

Post » Sat Dec 27, 2014 12:46 pm

If !(Game.GetPlayer().HasPerk(MyPerk))
User avatar
Tasha Clifford
 
Posts: 3295
Joined: Fri Jul 21, 2006 7:08 am


Return to V - Skyrim