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

What was Load Library replaced with?

Asked by 5 years ago
Edited by Gey4Jesus69 5 years ago

What was LoadLibrary replaced with, I can't seem to find it.

Ex.

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



local TC = C("RemoteEvent"){Name = "requestTeamChange", Parent = game:GetService("ReplicatedStorage")}

local N = C("BindableEvent"){Name = "sendTopNotification", Parent = game:GetService("ReplicatedStorage")}



TC.OnServerEvent:connect(function(Client, T, I, R)

if game:GetService("Teams"):FindFirstChild(T) then

if game:GetService("Teams")[T].TeamColor == Client.TeamColor then

N:Fire(Client.Name, "You are already on team: "..T, 3)

return

end

if T == game:GetService("Teams").Visitor then

game.Players[Client.Name].TeamColor = game.Teams.Visitor.TeamColor

wait(0.2)

game.Players[Client.Name]:LoadCharacter()

return

end

if Client:GetRankInGroup(I) >= R then

game.Players[Client.Name].TeamColor = game.Teams[T].TeamColor

wait(0.2)

game.Players[Client.Name]:LoadCharacter()

end

end

end)



N.Event:connect(function(P, T, WT)

if game.Players:FindFirstChild(P) then

local PGui = game.Players[P]:WaitForChild("PlayerGui")

if PGui:FindFirstChild("Notification") then

PGui["Notification"]:Destroy()

end

local NewGuiPart1 = Instance.new("ScreenGui")

NewGuiPart1.Name = "Notification"

NewGuiPart1.Parent = PGui

-------

local NewGuiPart2 = Instance.new("TextLabel")

NewGuiPart2.BackgroundColor3 = Color3.new(46/255, 72/255, 91/255)

NewGuiPart2.BorderSizePixel = 0

NewGuiPart2.Name = "NotificationText"

NewGuiPart2.Position = UDim2.new(0.5, -150,0.5, -250)

NewGuiPart2.Size = UDim2.new(0, 300, 0, 50)

NewGuiPart2.Font = Enum.Font.ArialBold

NewGuiPart2.FontSize = Enum.FontSize.Size14

NewGuiPart2.Text = T

NewGuiPart2.TextColor3 = Color3.new(1, 1, 1)

NewGuiPart2.TextWrapped = true

NewGuiPart2.TextScaled = true

NewGuiPart2.Parent = NewGuiPart1

wait(WT)

NewGuiPart1:Destroy()

end

end)





game:GetService("Players").PlayerAdded:connect(function(Player)

Player.CharacterAdded:connect(function(Character)

wait(5)

local Children = Character:GetChildren()

for i, v in pairs(Character.Head:GetChildren()) do

if v:IsA("SpecialMesh") then

v:Destroy()

end

end

local M = C("SpecialMesh"){Name = "Mesh", Parent = Character.Head, MeshType = Enum.MeshType.Head, Scale = Vector3.new(1.25,1.25,1.25)}

for i, v in pairs(Children) do

if v:IsA("CharacterMesh") then

v:Destroy()

N:Fire(Player.Name, "Packages Removed! \n Please refrain fron wearing packages in this game! \n Thank you!", 3)

end

end

end)

end)

1 answer

Log in to vote
0
Answered by 5 years ago

LoadLibrary.Create()was essentially a short-hand way of writing Instance.new(), with flexibility of altering properties before initializing the instance. The former method, of course, is not deprecated like the latter, and I personally think it's leaps and bounds easier to understand in terms of syntax. Read here for more information.

0
So it would be local C = assert(Instance.new("RbxUtility"))? KonstantinKovacs 5 — 5y
0
no, idk what the heck ur trying to do with that. to create an instance, we do: `local obj = Instance.new("ClassName")` and then set various properties Gey4Jesus69 2705 — 5y
0
It's a event handler for a team change GUI KonstantinKovacs 5 — 5y
0
im not talking about your whole code, im talking about what you just commented. you shouldnt use LoadLibrary at all, and I showed you how to avoid it. Gey4Jesus69 2705 — 5y
Ad

Answer this question