Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Difference between Instance.new RbxUtility.Create?

I am trying to find the difference between Instance.new and The rbxutility create function. The only thing I can think of is that the create function is a table and Instance creates just a represenitive object that is usually made a variable any comment?

2 answers

✓ Accepted answer

There really isn't much difference between the two. I believe that the .Create is just used for faster and more efficient instance property editing and for creating events pertaining to the instance.

-- .Create
local Create = assert(LoadLibrary("RbxUtility")).Create
local Part = Create "Part" {
     Parent     = Workspace;
     Name       = "Something";
     Anchored   = true;
     [Create.E "Touched"] = function()
          print("Touched")
     end
}

-- Instance.new
local part = Instance.new("Part", game.Workspace)
part.Anchored = true
part.Name = "Something"
part.Touched:connect(function()
	print("touched")
end)

The difference is this:

Instance.new("Part") -- Fires a preloaded function that BASICALLY does the same thing as
local newPart = LoadLibrary("RbxUtility").Create("Part")({
	Parent = workspace;
	Name = "Hi!"
}) 
-- The only difference is RBXUTILITY gives you a little more options.

This discussion is preserved as it was. New answers, comments, and votes are closed.