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

Difference between Instance.new RbxUtility.Create?

Asked by 8 years ago

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

Log in to vote
2
Answered by
4Bros 550 Moderation Voter
8 years ago

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)

Ad
Log in to vote
0
Answered by 8 years ago

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.

Answer this question