PDA

View Full Version : help with mc crouching



mayjarboi
January 4th, 2006, 02:52 PM
heres a code for a crouch punch attack, whats wrong with it


onClipEvent(enterFrame){ if (Key.isDown(Key.LEFT)){ if (Key.isDown(Key.65)){gotoAndStop{"CrouchAttack"}}}}

plz help

Joppe
January 4th, 2006, 03:28 PM
Key.isDown(Key.65))

should be


Key.isDown(65))

mayjarboi
January 4th, 2006, 03:39 PM
doesnt it need something like "&&" between the code for down and the code for punch?

NiñoScript
January 4th, 2006, 05:12 PM
if you dont use &&/and in your code (like you are doing it):

if left is pressed, check if Key 65 is, if it is, perform crouch attack

if you use it:

if left is pressed AND Key 65 is pressed too, perform crouch attack

see? they are the same

nathan99
January 4th, 2006, 06:07 PM
ugh, guys



onClipEvent(enterFrame){
if (Key.isDown(Key.LEFT)){
if (Key.isDown(Key.65)){
gotoAndStop{"CrouchAttack"}
}
}
}

should be



onClipEvent(enterFrame){
if (Key.isDown(Key.LEFT) && Key.isDown(65)){
gotoAndStop("CrouchAttack");
}
}

because oyu have {} wrapping around the frame to go to,

Ravmaster
January 5th, 2006, 12:19 PM
ZOMG i was actually close to making a code work lol i gave him that other code above n i see that i've missed a bit out but i realize what i did cool :D

mayjarboi
January 5th, 2006, 01:52 PM
i new there had to be a &&

thanks for the help nathan