Creating Instances with tables!

Hey everyone,

I created this a while back because I was pretty bored but either way, it might be useful.

https://www.roblox.com/library/9462813691/EZInstance

Basically it allows you to create a Instance with the properties as a table

Example code :slightly_smiling_face:

local Instance = require(script.EZInstance)
Instance.new("Part", {
  Parent = workspace,
  Transparency = 0.5
})

Thats pretty much it, fork it if you want.

4 Likes

mind telling me how this is usefull? and how this belongs in #help-and-feedback:creations-feedback? (it belongs in #resources:community-resources)

1 Like

vcool. I even made my own not so long ago (but more performant)

local function ezInstance(name, props)
   local obj = Instance.new(name)
   for i,v in pairs(props) do
      if not i == "Parent" then -- performance
         obj[i] = v
      end
   end
   local parentProperty = props["Parent"]
   if parentProperty then
      obj.Parent = parentProperty
   end
   return obj
end

local inst = ezInstance("Part", {
   Name = "Hi",
   Parent = workspace
})
2 Likes

oh my bad im new at this, thanks for telling me

1 Like