Module Lack of Permissions?

Hello,
Today I was making a dynamic sight system, via function in module. And now I have some questions about modules and their lacks of premissions.

So, I accidentally found out it by this code:

return {
    comp = {
        AimChanged = function(state: boolean, Weapon: Tool)
               local sight = Weapon:FindFirstChild("Sight", true)
              if state == true then
                  sight.DoubleSided = true
              else
                 sight.DoubleSided = false
              end
        end,
    }
}

I was coding this on my phone so dont blame me :confused:

Whenever player toggles aim, this function is being called with true or false in state. Everything seems alright, until one moment; an error that says you can’t set DoubleSided for meshparts though module.
That’s really sad for me.

Why DoubleSided property can’t be set though module? And where could I view those properties which are under lua protection?

https://create.roblox.com/docs/reference/engine/classes/MeshPart#DoubleSided
“This property determines whether to render both faces of polygons in the mesh. It is only changeable in Studio.”
It’s not only a modules thing, it’s just that you can’t change it in-game.

Oh, I see. Thanks.
I’ve should read documentation before write something…

Hacky but meight work:

Have a blank mesh with doublesided property already enabled and then try using :ApplyMesh

If you want to get meshid in runtime look at this property:
https://create.roblox.com/docs/reference/engine/classes/AssetService#CreateMeshPartAsync

Should work, thank ya.