MaRcell Posted April 27, 2015 Share Posted April 27, 2015 Eu queria Se Tem Jeito De criar Uma Animaçao Por button A pessoa Clica Num Button do teclado e começa a anim poderia mandar a base para min criar? Link to comment
n3wage Posted April 27, 2015 Share Posted April 27, 2015 --Funções: bindKey setPedAnimation --base: status = {} for _, v in pairs ( getElementsByType "player" ) do bindKey ( v, "m", "down", function(player) setPedAnimation( player, status[player] and "ped" or "", status[player] and "WOMAN_walknorm" or "") status[player] = not status[player] end ) end Link to comment
MaRcell Posted April 27, 2015 Author Share Posted April 27, 2015 [for _, v in pairs ( getElementsByType "player" ) do bindKey ( v, "m", "down", function(player) setPedAnimation( player, status[player] and "casino" or "manwinb", status[player] and "manwinb" or "casino") status[player] = not status[player] end ) end entao eu modifiquei o script com meus anim mas nao vai da o possivel erro ERROR : ERROR:attempnt To index global (a niil value ) Link to comment
n3wage Posted April 27, 2015 Share Posted April 27, 2015 ficou um pouco confuso meu codigo , tente assim: status = {} function anim ( player ) if not status[player] then setPedAnimation( player, "casino", "manwinb" ) else setPedAnimation ( player, "", "" ) end status[player] = not status[player] end for _, v in pairs ( getElementsByType "player" ) do bindKey ( v, "m", "down", anim ) end ( voce vai ter que 'bindar' a key dnv quando o player entrar no servidor (onPlayerJoin) ) Link to comment
MaRcell Posted April 27, 2015 Author Share Posted April 27, 2015 como assim "bindar"? Link to comment
n3wage Posted April 27, 2015 Share Posted April 27, 2015 como assim "bindar"? usar bindKey de novo, assim: addEventHandler ( "onPlayerJoin", root, function() bindKey ( source, "m", "down", anim ) end ) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now