Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would I create / edit an Instance by calling it from a variable of a ClassName / Property?

Asked by 4 years ago

If I had a module script and wanted to create an Instance from calling a ClassName (Variable) or Property, how would I do that?

local CreateInstances = {

function Create(ClassName)
      --Question's answer -w-
      funtion ClassName(Property)
            return Property
      end
      return ClassName
end

Create'Part' = {
Part.CanCollide = false
Part.Position = Vector3.new(x,y,z)
}

}
0
(the functions were supposed to be separated as module scripts, but the rest is a script.) ISkyLordDoge 37 — 4y
0
so you're trying to make a module that mymics instance.new? royaltoe 5144 — 4y
0
this would be a module script that creates a new part instance. but it's a bit unnecessary because you can just use instance.new() alone. https://pastebin.com/xbcgu37L. what are you trying to do exactly? royaltoe 5144 — 4y
0
I'm trying to define the ClassName of something as the variable 'Create' and create a new Instance from calling Create('ClassName') and the same for properties. ISkyLordDoge 37 — 4y

Answer this question