Bean666 Posted April 19, 2015 Share 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 Link to comment
ALw7sH Posted April 19, 2015 Share Posted April 19, 2015 function invisible() if getElementModel(localPlayer) == 179 then setElementAlpha(localPlayer, 0) end end addCommandHandler ( "invisible", invisible ) Link to comment
Bean666 Posted April 19, 2015 Author Share Posted April 19, 2015 (edited) removed Edited April 19, 2015 by Guest Link to comment
Bean666 Posted April 19, 2015 Author Share Posted April 19, 2015 not that walid , that function is when he gets dmge , i wan't if he shoots he loses his invisibility. Link to comment
WhoAmI Posted April 19, 2015 Share Posted April 19, 2015 Leave your script s-side and use this c-side: addEventHandler ( "onClientPlayerWeaponFire", root, function ( ) setElementAlpha ( source, 255 ); end ); Link to comment
Walid Posted April 19, 2015 Share 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. Link to comment
WhoAmI Posted April 19, 2015 Share Posted April 19, 2015 Are you drunk? The source of this event is the streamed in player who fired the weapon. Link to comment
Bean666 Posted April 19, 2015 Author Share 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. Link to comment
Walid Posted April 19, 2015 Share 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 Link to comment
ALw7sH Posted April 19, 2015 Share 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 ) Link to comment
WhoAmI Posted April 19, 2015 Share 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 ) Link to comment
Bean666 Posted April 19, 2015 Author Share Posted April 19, 2015 ok wait EDIT: Doesnt work guys i don't get invisibility. Link to comment
WhoAmI Posted April 19, 2015 Share Posted April 19, 2015 Which code do you use and in what side (client/server)? Link to comment
Walid Posted April 19, 2015 Share Posted April 19, 2015 im using client. try to use my code WhoAmI code is server side. Link to comment
WhoAmI Posted April 19, 2015 Share 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 Link to comment
Bean666 Posted April 19, 2015 Author Share Posted April 19, 2015 whoami your code work , thank you. Link to comment
Bean666 Posted April 19, 2015 Author Share Posted April 19, 2015 oh i have more one favor haha , is it also possible when a player falls , he gets no damage? Link to comment
WhoAmI Posted April 19, 2015 Share Posted April 19, 2015 addEventHandler ( "onClientPlayerDamage", localPlayer, function ( _, id ) if ( id == 54 ) then -- 54 is the fall id. cancelEvent ( ); end end ); Also client-side. Link to comment
Bean666 Posted April 19, 2015 Author Share Posted April 19, 2015 can u also make it for skin 179? Link to comment
WhoAmI Posted April 20, 2015 Share 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 ); Link to comment
Tekken Posted April 20, 2015 Share 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) 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