How to save mesh textureId when player leaves game

The next thing you would need to do is some simple datastore saving using:

Store:SetAysnc()

Store:GetAysnc()

Have you looked into datastores already?

And checking when a player leaves:

https://developer.roblox.com/en-us/api-reference/event/Players/PlayerRemoving

More advanced version:

Another resource: