Howdy! As a Roblox developer, it is currently too hard and impossible to change an Instances’ ClassName
of certain properties such as a Script
, folder, a UI element or possibly changing it through a script without having to do extra procedures and measures to get a different ClassName
of one instance.
At the moment, it’s been hard trying to switch through classes of an Instance of a parent(s) like a TextLabel as I need to use a plugin or some hacky method to get ones’ class like changing it from a Script
> LocalScript
, or another method through code like using Enum or a string with an =
variable.
However, there are workarounds like Reclass by Elttob which works out fine and has an excellent motive for development, but having some sort of availability for developers to select and change would be somehow beneficial in many ways for class-switching.
A friend of mine @FilteredDev gave me an idea for this and a way to change a class of ones’ Instance ClassName
through the Command Bar or a script:
Part = setmetatable({ClassName = "NotPart"}, {__index = Part})
It works, however, it would be beneficial as I’ve explained above with properties and scripts, it’ll be faster and more reliable to do rather than using setmetatable()
and __index
for certain situations as above.
With coding through a script, I purpose some ideas:
-
:GetService()
: I’m not too familiar with the range of using Service, but having a Class service forClassName
would be beneficial along with changing it through properties. -
Enums’; it’ll behave the same with the Enum class and index family-like UserInputService with a
if / then
statement or changing it for certain situations. -
It’ll have custom properties for
ClassName
like what type of Class to change it through like an Enum or a string (""
) to do the following:
Or:
local class = game.Workspace.Brick.ClassName
class.ClassType = Enum.ClassType.ModuleScript
if class.ClassType = Enum.ClassType.ModuleScript then
print("Module!")
end
Those are some of my suggestions and ideas that would improve scripting through ClassName
and changing it through properties and such, maybe not the scripting part a bit but properties, yes.
If Roblox is able to address this issue, it would improve my development experience, my development workflow, and how I manage my properties and instances across studio and in-game because it’ll be faster and more reliable to manage and change through properties and on a Script
or ModuleScript
or a Folder if possible through a script and such.
When a certain class like a Script
which is server-sided is changed into a LocalScript
as some instances’ need to change in certain procedures, the behavior which is altered would change as it’ll turn from a server-side component to a client-side component and script, it should also be changed to a similar class like scripts or a UI element depending on that specific class
It’ll never be inherited from an outside class or an abstract class like from a TextLabel => Script
as mentioned by dibblydubblydoo and won’t do such behavior overall with this feature.