Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   can't find a work around for if a player misses a hit (https://forums.graalonline.com/forums/showthread.php?t=134269253)

khortez 05-29-2014 09:15 PM

can't find a work around for if a player misses a hit
 
PHP Code:

function Swing(){
  if(
null in player.3player.1.5 } ){ 
    
triggeraction(player.3player.1.5"Contact"player.account);
    
player.chat "Contact!";
  }else{
     
player.chat "No contact!";
   }


I've been trying to check if the player hit's nothing. been kind of difficult to do and this is my latest attempt, any suggestions?

Jakov_the_Jakovasaur 05-29-2014 09:47 PM

there is no sure way of knowing whether a hit has landed when using that triggeraction method, you will need to loop through players and check for whether their body intersects with the attack area.

its also worth mentioning that your conditional statement doesnt make any sense (it would return true by a quirk if one of your coordinates were 0) and you need to factor in the direction of the player

khortez 05-29-2014 10:10 PM

Quote:

Originally Posted by Jakov_the_Jakovasaur (Post 1727567)
there is no sure way of knowing whether a hit has landed when using that triggeraction method, you will need to loop through players and check for whether their body intersects with the attack area.

its also worth mentioning that your conditional statement doesnt make any sense (it would return true by a quirk if one of your coordinates were 0) and you need to factor in the direction of the player

i think i understand what you mean, thanks. i'll try again


All times are GMT +2. The time now is 04:33 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.