Checking if the skill hits the target or misses

Hello people, i am new on this forum i need help with something as the title says.
i need to check a skill hits the target, the skill plays a movie in a common event but it needs to check first if the skill hit the player or missed it. In the example picture i tried those codes one at a time but they are not working can someone help?

note: I don't want to use any plugin if there is a way, if not i am using visustellaz battle core plugin but its pretty complicated i couldn't find anything for my need about this.
The first and last of those have very incorrect syntax.

The middle one is correct syntax, but not to do what your post says it wants.

it needs to check first if the skill hit the player or missed it
The player exists in the $gameParty, not the $gameTroop. So if you're checking whether the skill hit an actor, you would look at $gameParty.members()[$gameSystem.lastActionData(4).index()] or the appropriate reference from the BattleManager.

But if you do have VisuStella Battle Core installed, it would be much simpler to just use that. All of the mechanics-related notetags are listed right in one place.

Code:
<JS Post-Apply>
if (target.result().missed)
// look up the script call to play a video
</JS Post-Apply>
First thank you for your reply, i tried what you said i hope i did it right but it gives error now like this;
...you didn't put the script call to play the video on the line after the if. I even wrote the instruction to do so in there for you.
Whatever is in your if statement needs to return true or false. Your last picture looks like it should return a number
...you didn't put the script call to play the video on the line after the if. I even wrote the instruction to do so in there for you.
sorry i have not good english, i see that but i don't understand what is the script call and where should i write it

...you didn't put the script call to play the video on the line after the if. I even wrote the instruction to do so in there for you.
or maybe you said its easier with visustella plugin can you show me how to do it?

Whatever is in your if statement needs to return true or false. Your last picture looks like it should return a number
do you mean after index ?
You may want to back up and do some more general tutorials about RPG Maker MZ before starting off on your main project.

or maybe you said its easier with visustella plugin can you show me how to do it?
Notetags only do anything if you have a plugin that reads them; the notetag I wrote for you is because of the VisuStella Battle Core.

sorry i have not good english
Then why is English selected as your first language on your profile? If that setting is accurate, it will help other people communicate with you.

i see that but i don't understand what is the script call

and where should i write it
On the line where I told you to look up the script call and type it there.

do you mean after index ?
Yes, you didn't keep the .result().missed at the end. But I don't understand why you're trying to do both things at the same time. You should not have any common event at all if you're doing it via notetag.
You may want to back up and do some more general tutorials about RPG Maker MZ before starting off on your main project.
i watched tutorials enough but there are no any plugin tutorials i learned them all by myself.
Notetags only do anything if you have a plugin that reads them; the notetag I wrote for you is because of the VisuStella Battle Core.
i understand, i didn't know that.
Then why is English selected as your first language on your profile? If that setting is accurate, it will help other people communicate with you.
because i didn't pay atention while creating the account and my first language is turkish and i don't think there is any turkihs people here 😀
this doesn't help i checked all the links it doesn't give any proper script call about video playing 🙁 can you please write the script call or show me the exact link because none of them are working and yes i wrote those script calls in notetag where you made // i replace it
On the line where I told you to look up the script call and type it there.
yes i did write the codes one by one an tried
Yes, you didn't keep the .result().missed at the end. But I don't understand why you're trying to do both things at the same time. You should not have any common event at all if you're doing it via notetag.
"$gameParty.members()[$gameSystem.lastActionData(4).index()]" because i copy this you gave me the code 😀
To be fair, even googling mz scriptcalls can return just mv ones.
You can search the forum for a thread 'RPG Maker MV / MZ Script Call List' that will give you a link to all the scripts.

In there it says:

// In a Script command: play sample.webm (video filename without extension) this.command261(['sample']);
To be fair, even googling mz scriptcalls can return just mv ones.
You can search the forum for a thread 'RPG Maker MV / MZ Script Call List' that will give you a link to all the scripts.

In there it says:

// In a Script command: play sample.webm (video filename without extension) this.command261(['sample']);
thank you for your reply, sadly i found it but it says it is only for MV
No, there's different rows for MV and MZ. Look to the left. The script I posted is the MZ one.
No, there's different rows for MV and MZ. Look to the left. The script I posted is the MZ one.
i tried it didn't work it also didn't gave any error, can you please write me the exactly the code with my video file name it is : DoubleAttack
<JS Post-Apply>
if (target.result().missed)
// i will write it here right?
</JS Post-Apply>
this is the skills notetag.
Hmmm, isn't your conditional returning true if the attack missed? Didn't you want to play the video when it hit? Shouldn't you put the '!' mark before it? I'm not 100% sure. Below is the notetag with the exclamation mark...

<JS Post-Apply> if (!target.result().missed) this.command261(['DoubleAttack']); </JS Post-Apply>

EDIT: Might need to check for evades too? Or use the "if hit" script?
Hmmm, isn't your conditional returning true if the attack missed? Didn't you want to play the video when it hit? Shouldn't you put the '!' mark before it? I'm not 100% sure. Below is the notetag with the exclamation mark...

<JS Post-Apply> if (!target.result().missed) this.command261(['DoubleAttack']); </JS Post-Apply>

EDIT: Might need to check for evades too? Or use the "if hit" script?
because i copied what the other guy said seems all of the codes he gave me is missing something then maybe he should watch some tutorials before posting here 😀

i tried yours but it didn't help and also with hit and evades it just does nothing both if the skill hits or misses 🙁
because i copied what the other guy said seems all of the codes he gave me is missing something then maybe he should watch some tutorials before posting here 😀

i tried yours but it didn't help and also with hit and evades it just does nothing both if the skill hits or misses 🙁
You also didn't really follow directions, tried to use a plugin script and common event for the same thing at the same time when he said to use one or the other, and seem to need A LOT of handholding. Even if someone gives you a script with a mistake (it happens, I've done it), you're the one blindly copying and pasting it in without thinking about what it does or trying to understand anything.
You also didn't really follow directions, tried to use a plugin script and common event for the same thing at the same time when he said to use one or the other, and seem to need A LOT of handholding. Even if someone gives you a script with a mistake (it happens, I've done it), you're the one blindly copying and pasting it in without thinking about what it does or trying to understand anything.
I told i am new here and i didn't know both codes are different ways and i tried both ways still seems not working so thats not the right codes then and i gave up 6 hours to this :/
Could you press F8 (or Fn then F8) after the attack and click on the Console tab to see if there is an error message?
because i copied what the other guy said seems all of the codes he gave me is missing something then maybe he should watch some tutorials before posting here 😀
I told i am new here and i didn't know both codes are different ways and i tried both ways still seems not working so thats not the right codes then and i gave up 6 hours to this :/
Its going to end up taking you alot longer than 6 hours to fix stuff in the future if youre going to be like that. you dont ask for help from strangers to do something, misinterpret the instructions given to you, and then say that the person that tried to help you should go and take some tutorials because it didnt work when you didnt follow the directions. take your own advice next time and watch some tutorials yourself if youre going to do that
I originally just jumped in this thread to give you the 'play movie' script from the script call list, so I'm no expert on this.

But I tested it and it tells me that that command261 is not a function. Then I just tried:

Video.play("movies/" + "DoubleAttack" + ".webm"); this.setWaitMode("video");

It did play the video, but then it says that this.setWaitMode is not a function. I don't have the skills to help you more.
Its going to end up taking you alot longer than 6 hours to fix stuff in the future if youre going to be like that. you dont ask for help from strangers to do something, misinterpret the instructions given to you, and then say that the person that tried to help you should go and take some tutorials because it didnt work when you didnt follow the directions. take your own advice next time and watch some tutorials yourself if youre going to do that
i was joking about what he said to me read the previous answers, i am not trying to be rude here i am not the one here giving sarcastically answers, i meant thats not easy stuff to do it obviously since you guys can't solve it does that mean "I have to watch tutorials?" i just want help and you are posting about my mistakes and lacking of skills.

Original thread: https://forums.rpgmakerweb.com/threads/checking-if-the-skill-hits-the-target-or-misses.162964/