AlimAge Posted April 23, 2023 Share Posted April 23, 2023 I wrote an OnHit script which I attached to the enemy. The script teleports the enemy to the place I need with the MoveTo command, however, after teleportation, the enemy ceases to be hostile(previously I made it hostile via the StartCombat command in the dialog)I tried to write StartCombat at the end of Event OnHit, but it says that StartCombat not a function or does not existCan you please tell me how to solve this situation? Link to comment Share on other sites More sharing options...
dylbill Posted April 23, 2023 Share Posted April 23, 2023 What does your script extend? If it extends Actor, you should be able to use just StartCombat(game.getPlayer()) If your script extends ReferenceAlias though, you would have to do something like GetActorReference().StartCombat(game.getPlayer()) Basically StartCombat must be used on an actor. Link to comment Share on other sites More sharing options...
AlimAge Posted April 24, 2023 Author Share Posted April 24, 2023 What does your script extend? If it extends Actor, you should be able to use just StartCombat(game.getPlayer()) If your script extends ReferenceAlias though, you would have to do something like GetActorReference().StartCombat(game.getPlayer()) Basically StartCombat must be used on an actor.Thank you. I really didn't notice that I didn't set Actor but ObjectReference . Also the information about ReferenceAlias was helpful, I'll keep that in mind. Link to comment Share on other sites More sharing options...
dylbill Posted April 24, 2023 Share Posted April 24, 2023 No problem, happy modding :) Link to comment Share on other sites More sharing options...
Recommended Posts