2 Is OOP possible on instances(parts) in Roblox?

for example :

function newTransparency(self, newT) 
self.Transparency = newT
Part = workspace.Part
1 Like

I don’t think so but I will try to figure this out.

1 Like

Judging by the code provided, this is not possible. You can add functionality but not directly.


can u please give an example it would be very helpfull since i am new to OOP.

Set up the generic object with OOP style:

local object = {}
object.__index = object
function object.new(Part)
    local construct = {}
    construct.Part = Part
    return setmetatable(construct, object)
function object:newTransparency(newT)
    self.Part = newT --> setting the parts transparency to [newT]
return object
local thing = require() --> path to module
local Part = workspace.Part

local partWithExtraFunctionality = thing.new(Part) --> adding indirect functionality
partWithExtraFunctionality:newTransparency(0.5) --> calling the added functionality
1 Like