Kelvenbrryan Posted January 15, 2022 Share Posted January 15, 2022 Bom estou tendo o seguinte problema com as sniper da minha gm quando miro rapido a textura da arma fica na frente, me passaram esse codigo deu certo por enquanto mira rapido o bug volta local alpha = 255 bindKey ( "aim_weapon", "both", function ( _, state ) if getPedWeaponSlot ( localPlayer ) == 6 then if ( state == "down" ) then alpha = 0 elseif ( state == "up" ) then alpha = 255 end for _, v in ipairs ( getElementsByType ( "object", root, true ) ) do if isElementAttachedToBone ( v ) then local id = getElementModel ( v ) if ( id == 2584 ) setElementAlpha ( v, alpha ) end end en https://imgur.com/a/aZvvU Well I'm having the following problem with my gm's sniper when I aim quickly, the texture of the weapon is in front, they gave me this code it worked for now, quickly aim the bug back. Link to comment
Administrators Tut Posted January 15, 2022 Administrators Share Posted January 15, 2022 Moving this into the Portuguese scripting section. Link to comment
Other Languages Moderators androksi Posted January 16, 2022 Other Languages Moderators Share Posted January 16, 2022 E aí, @Kelvenbrryan! Corrigi o código pra você. local alpha = 255 bindKey ( "aim_weapon", "both", function ( _, state ) if getPedWeaponSlot ( localPlayer ) == 6 then if ( state == "down" ) then alpha = 0 elseif ( state == "up" ) then alpha = 255 end for _, v in ipairs ( getElementsByType ( "object", root, true ) ) do if isElementAttachedToBone ( v ) then local id = getElementModel ( v ) if ( id == 2584 ) then setElementAlpha ( v, alpha ) setElementDimension(v, alpha == 0 and 9999 or getElementDimension(localPlayer)) end end end end end Peço que por favor, nas próximas vezes que postar algo, use a ferramenta Code (<>) e indente o seu código. 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