for example :
function newTransparency(self, newT)
self.Transparency = newT
end
Part = workspace.Part
Part:newTransparency(0.5)
for example :
function newTransparency(self, newT)
self.Transparency = newT
end
Part = workspace.Part
Part:newTransparency(0.5)
I don’t think so but I will try to figure this out.
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)
end
function object:newTransparency(newT)
self.Part = newT --> setting the parts transparency to [newT]
end
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