To address the compiler error first (guessing at the line here since you didn’t include the line number in the error message) – the compiler is reading the following line of your script "Actor DebugBoss.ModAV("Health", actual)" and is getting confused because it thinks you are defining a variable named DebugBoss and it isn’t expecting the ‘.’ character.
In terms of your original question, you’ve already figured out that to call ModAV on the player, you need to put “Game.GetPlayer()” in front of a ‘.’ character with “ModAV” after the ‘.’ If you want ModAV to work on something that isn’t the player, you need to replace what is before the ‘.’ with something else. In a lot of cases this will be a variable or property you define in your script. For example, to call ModAV on a property, you might have something like this:
Actor Property OtherGuy AutoEvent OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, \bool abBashAttack, bool abHitBlocked) OtherGuy.ModAV("Health", 10)EndEventAnd then, when you attach your script to something in the editor, you use the property window to point “OtherGuy” at the actor you want to affect.
In your particular example, it looks like what you want to do is affect the actor that your script is attached to, in which case we can actually save you some typing. First, change the “extends ObjectReference” at the top of your script to “extends Actor” – this tells the compiler that your script will be attached to Actors in the game (and also means the game won’t let you attach the script to anything that isn’t an actor). Next, change “Actor DebugBoss.ModAV("Health", actual)” to simply “ModAV("Health", actual)”. You’ll notice there is no ‘.’ If there is no ‘.’ (the function is just on its own), then the compiler assumes that what you want to affect is the object the script is attached to, rather than something else.
You should end up with something like this:
Scriptname DebugBoss extends ActorEvent OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, \bool abBashAttack, bool abHitBlocked) float playerPen = Game.GetPlayer().GetActorValue("fame") as float float playerAttack = Game.GetPlayer().GetActorValue("MeleeDamage") as float float actual = playerPen + PlayerAttack ModAV("Health", actual)EndEventHopefully that was clear enough and helps
