Advertisement
SinisterMemories

Instance.lua

Apr 7th, 2020
378
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.48 KB | None | 0 0
  1. -- [[ Instance Module Declaration ]] --
  2.  
  3. local instance = {}
  4.  
  5. do
  6.     --// Instance Methods
  7.    
  8.     function instance.new(class, properties)
  9.         local newInstance = Instance.new(class)
  10.         local parent = dictionary.remove(properties, "Parent")
  11.        
  12.         for propertyName, propertyValue in pairs(properties) do
  13.             newInstance[propertyName] = propertyValue
  14.         end
  15.        
  16.         if parent then
  17.             newInstance.Parent = parent
  18.         end
  19.        
  20.         return newInstance
  21.     end
  22. end
  23.  
  24. -- [[ Init ]] --
  25.  
  26. return instance
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement