Bean666 Posted April 19, 2015 Posted April 19, 2015 (edited) is there anyway that this command will only work in a skin ID Which is 179? help please and is there also a way if the player shoots he loses his invisibility , thanks function toggleInvis ( thePlayer ) if getElementAlpha( thePlayer ) == 255 then setElementAlpha ( thePlayer, 0 ) else setElementAlpha ( thePlayer, 255 ) end end addCommandHandler ( "invis", toggleInvis ) Edited April 19, 2015 by Guest
ALw7sH Posted April 19, 2015 Posted April 19, 2015 function invisible() if getElementModel(localPlayer) == 179 then setElementAlpha(localPlayer, 0) end end addCommandHandler ( "invisible", invisible )
Bean666 Posted April 19, 2015 Author Posted April 19, 2015 (edited) removed Edited April 19, 2015 by Guest
Bean666 Posted April 19, 2015 Author Posted April 19, 2015 not that walid , that function is when he gets dmge , i wan't if he shoots he loses his invisibility.
WhoAmI Posted April 19, 2015 Posted April 19, 2015 Leave your script s-side and use this c-side: addEventHandler ( "onClientPlayerWeaponFire", root, function ( ) setElementAlpha ( source, 255 ); end );
Walid Posted April 19, 2015 Posted April 19, 2015 Leave your script s-side and use this c-side: addEventHandler ( "onClientPlayerWeaponFire", root, function ( ) setElementAlpha ( source, 255 ); end ); the source of this event is the weapon that was fired.
WhoAmI Posted April 19, 2015 Posted April 19, 2015 Are you drunk? The source of this event is the streamed in player who fired the weapon.
Bean666 Posted April 19, 2015 Author Posted April 19, 2015 function invisible() if getElementModel(localPlayer) == 179 then setElementAlpha(localPlayer, 0) end end addCommandHandler ( "invisible", invisible ) is there anyway that if i do the /invisible command again ill go back to the alpha 255? and btw Whoami it worked ty.
Walid Posted April 19, 2015 Posted April 19, 2015 (edited) function invisible() if getElementModel(localPlayer) == 179 then setElementAlpha(localPlayer, 0) end end addCommandHandler ( "invisible", invisible ) is there anyway that if i do the /invisible command again ill go back to the alpha 255? and btw Whoami it worked ty. use getElementAlpha () Example function invisible() if getElementModel(localPlayer) == 179 then if getElementAlpha (localPlayer) == 255 then setElementAlpha(localPlayer, 0) else setElementAlpha(localPlayer, 255) end end end addCommandHandler ( "invisible", invisible ) Edited April 19, 2015 by Guest
ALw7sH Posted April 19, 2015 Posted April 19, 2015 function invisible() if getElementModel(localPlayer) == 179 then if getElementAlpha ~= 255 then setElementAlpha(localPlayer, 255) else setElementAlpha(localPlayer, 0) end end end addCommandHandler ( "invisible", invisible )
WhoAmI Posted April 19, 2015 Posted April 19, 2015 function invisible ( player ) if ( getElementModel ( player ) == 179 ) then local n = ( getElementAlpha ( player ) > 0 ) and 0 or 255; setElementAlpha ( player, n ); end end addCommandHandler ( "invisible", invisible )
Bean666 Posted April 19, 2015 Author Posted April 19, 2015 ok wait EDIT: Doesnt work guys i don't get invisibility.
WhoAmI Posted April 19, 2015 Posted April 19, 2015 Which code do you use and in what side (client/server)?
Walid Posted April 19, 2015 Posted April 19, 2015 im using client. try to use my code WhoAmI code is server side.
WhoAmI Posted April 19, 2015 Posted April 19, 2015 function invisible ( ) if ( getElementModel ( localPlayer ) == 179 ) then local n = ( getElementAlpha ( localPlayer ) > 0 ) and 0 or 255; setElementAlpha ( localPlayer, n ); end end addCommandHandler ( "invisible", invisible ) Use it client
Bean666 Posted April 19, 2015 Author Posted April 19, 2015 oh i have more one favor haha , is it also possible when a player falls , he gets no damage?
WhoAmI Posted April 19, 2015 Posted April 19, 2015 addEventHandler ( "onClientPlayerDamage", localPlayer, function ( _, id ) if ( id == 54 ) then -- 54 is the fall id. cancelEvent ( ); end end ); Also client-side.
WhoAmI Posted April 20, 2015 Posted April 20, 2015 addEventHandler ( "onClientPlayerDamage", localPlayer, function ( _, id ) if ( id == 54 and getElementModel ( localPlayer ) == 179 ) then -- 54 is the fall id. cancelEvent ( ); end end );
Tekken Posted April 20, 2015 Posted April 20, 2015 Server function toggleInvis(thePlayer) local id = getElementModel(thePlayer) if id == 179 then local alpha = getElementAlpha(thePlayer) if alpha == 255 then setElementAlpha(thePlayer, 0) else setElementAlpha(thePlayer, 255) end else setElementAlpha(thePlayer, 255) end end addCommandHandler("invis", toggleInvis) Client function showOnShoot() setElementAlpha(source, 255) end addEventHandler("onClientPlayerWeaponFire", getLocalPlayer(), showOnShoot)
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