Plate Posted August 26, 2012 Posted August 26, 2012 Hola me dirian como puedo hacer para que cuando el jugador deje de tocar la w el player deje de hacer esa animacion function camina(button, press) if (press) then if button == 'w' then setPedAnimation ( source, "muscular", "MuscleRun") else setPedAnimation(source,false) end end end addEventHandler("onClientKey", getRootElement(), camina)
Plate Posted August 26, 2012 Author Posted August 26, 2012 No dije que tubiera errores dije que cuando el jugador deje de apretar la w el player deje de caminar por que vos apretas la w y sigue y sigue y sigue y no frena
Soren Posted August 26, 2012 Posted August 26, 2012 function camina(button, press) function camina(button, press) if (press) button == 'w' then setPedAnimation ( source, "muscular", "MuscleRun") else setPedAnimation(source,false) end end end addEventHandler("onClientKey", getRootElement(), camina) ???
BorderLine Posted August 26, 2012 Posted August 26, 2012 deberas usar la funcion bindKey cheka los argumentos del keyState dice tiene 3 distintas Deberas usar el state "down" (explica que al undir el boton se ejecutara) osea, ke al undir la tecla W ara la animacion y deberas usar la misma bind key pero en state "up" que al soltar la tecla, deje de hacer la animacion.. Suerte
Plate Posted August 26, 2012 Author Posted August 26, 2012 jaja igual no se hagan problema chicos no lo voy a poner en el server al final
iFoReX Posted August 26, 2012 Posted August 26, 2012 usa un bindkey con el argumento Both que es para que se realize una accion solo cuando mantienes precionado un boton c:
Plate Posted August 27, 2012 Author Posted August 27, 2012 Jaja ya no lo necesito a menos que me quieran ayudar a terminarlo y lo subimos a la comunidad
Recommended Posts