I need help to fix this invisibility code

Sorry for the delay in responding.
Actually, at the time I solved the problem in another way: every time a player mounts an animal, he receives an item and this item makes him invisible when it is in his inventory.