MaRcell Posted April 27, 2015 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?
n3wage Posted April 27, 2015 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
MaRcell Posted April 27, 2015 Author 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 )
n3wage Posted April 27, 2015 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) )
n3wage Posted April 27, 2015 Posted April 27, 2015 como assim "bindar"? usar bindKey de novo, assim: addEventHandler ( "onPlayerJoin", root, function() bindKey ( source, "m", "down", anim ) end )
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