Equipment Invisible to Local Player Only

I have an equipment that is attached to all players when the games starts. It works great, but I would like to make the local player's equipment invisible from view (but still able see other player's equipment). The code I put together is making all player's equipment invisible. I'm not sure how to have the local player's equipment invisible to only the local player.

Also, I tried this as well but with no success:

Thank you for your help in advance.

FleshyOverlord on Discord was able to help out! I hope this can also help others in the future.

You can use this function to make the local player's equipment invisible. It will search through all equipment a player has and check if each equipment object has a custom property named "MakeInvisbileLocaly". If so, it will search for client contexts within the equipment and make all children of those client contexts invisible. You should place this function within a client context and ONLY call it when the equippedEvent is fired because the script can be very CPU intensive (though it will be fine if it is only called once, everytime the player equips an item).

```
function MakeEquipmentInvisible()
  --Get the local player's equipment
  local Equipment = Game.GetLocalPlayer():GetEquipment()
  for _, equipment in ipairs(Equipment) do
--Check if the equipment has the "MaveInvisbileLocaly" custom proeprty, if so, make it invisible
    if(equipment:GetCustomProperty("MakeInvisbileLocaly")) then
      --Get the client context folder that contains the geometry
      local clientContexts = equipment:FindDescendantsByType("ClientContext")
      for i, context in ipairs(clientContexts) do
        --make all the objects invisible
        for k, child in ipairs(context:GetChildren()) do
          --Make the child invisible
          child.visibility = Visibility.FORCE_OFF
        end
      end
    end
  end
end
```

I believe you are going to have to work with just getting the Local player. Check out the documentation and let us know if it gets you where you need to go. If not, definitely hit us back up and maybe explain how you are currently working it.

GetLocalPlayer API Reference Link

I think you can probably just get the local player and run code against just that player with something similar to the example code found in the documentation at that link.