PDA

View Full Version : can't find a work around for if a player misses a hit


khortez
05-29-2014, 09:15 PM
function Swing(){
if(null in { player.x + 3, player.y + 1.5 } ){
triggeraction(player.x + 3, player.y + 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
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