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

How to reference LoadLibrary? Any alternatives?

Asked by 4 years ago

How do you reference LoadLibrary? Any alternatives? Here's my snip:

local LoadLibrary = LoadLibrary

I'm trying to make a script builder so any help would be awesome!

0
loadlibrary isn't a function anymore so u can't, or atleast I think that you can't DEVLogos 8 — 4y
0
I know that it is deprecated but should I delete it instead? SkyRedGamerHDYT 0 — 4y

1 answer

Log in to vote
0
Answered by
DanzLua 2879 Moderation Voter Community Moderator
4 years ago

LoadLibrary hasn't been used for quite while and has been replaced. To create a new instance we use Instance.New("Class")

Taking this example from the wiki about LoadLibrary

local RbxUtility = LoadLibrary("RbxUtility")
local Create = RbxUtility.Create

local redPart = Create "Part" {
    Name = "Red Part";
    Transparency = 0.5;
    BrickColor = BrickColor.new("Bright red");
    Position = Vector3.new(5, 5, 5);
    Parent = workspace;
}

Instead of doing this we should do this

local redPart = Instance.new("Part")
redPart.Name = "Red Part"
redPart.Transparency = 0.5
redPart.BrickColor = BrickColor.new("Bright red")
redPart.Position = Vector3.new(5, 5, 5)
redPart.Parent = workspace

You shouldn't use the second argument of Instance.new to parent that instance immediately because it will take longing to replicate it.

Instance.new("Part",workspace) -- <-- bad

More in depth reason

Ad

Answer this question