Load Library fix

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I know there’s a way to fix LoadLibrary functions since the day it got depreciated in February.
  2. What is the issue? Include screenshots / videos if possible!

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    None yet, because I don’t know what to do at this point.
    Script:
repeat wait () until game.Workspace.CurrentCamera ~= nil

local c = game.Workspace.CurrentCamera
local data = LoadLibrary("RbxUtility").DecodeJSON(script:WaitForChild("CutsceneData").Value) -- Line 4
local rs = game:GetService("RunService").RenderStepped
3 Likes

If it’s JSON Decoding, this should be helpful.

If you need LoadLibrary, there is a file on this post that has the modules for LoadLibrary, along with instructions on how to use LoadLibrary as a module.

4 Likes

I’ve tried that post, but it seems like my custscene isn’t working still…

If you are just looking for decoding/encoding string and arrays to/from JSON, then just use HTTP service’s like this. If it is not working, something else in your code must have broken.

repeat wait () until game.Workspace.CurrentCamera ~= nil

local c = game.Workspace.CurrentCamera
local data = game:GetService("HttpService"):JSONDecode(script:WaitForChild("CutsceneData").Value) -- Line 4
local rs = game:GetService("RunService").RenderStepped

I hope this helps!

I’ve tried that, and it still doesn’t work apparently. But this is the LocalScript for the ClientSide to load the loadingscreen and all:

local Player = game.Players.LocalPlayer

local PlayerGui = Player:WaitForChild("PlayerGui")

repeat wait() until Player.PlayerGui:FindFirstChild("ControlGui")

Player.PlayerGui.ControlGui.BottomLeftControl.Visible = false

local Interface = PlayerGui:WaitForChild("Interface")

Interface.Enabled = false

PlayerGui:SetTopbarTransparency(0)

game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All,false)

local CutsceneScript = script:WaitForChild("CutsceneScript")

CutsceneScript.Parent = PlayerGui

local Blur = Instance.new("BlurEffect",game.Lighting)

Blur.Size = 15

local LoadingScreen = script.Parent

local MainFrame = LoadingScreen:WaitForChild("MainFrame")

MainFrame.Visible = true

local LoadBarHolder = MainFrame:WaitForChild("LoadBarHolder")

local LoadBar = LoadBarHolder:WaitForChild("LoadBar")

local LoadingText = MainFrame:WaitForChild("LoadingText")

local GameNameText = MainFrame:WaitForChild("LoadingGameName")

local Music = LoadingScreen:WaitForChild("Music")

local Menu = LoadingScreen:WaitForChild("Menu")

local PlayButton = Menu:WaitForChild("PlayButton")

local GameMusic = workspace:WaitForChild("Mechanics"):WaitForChild("Sounds"):WaitForChild("Music")

GameMusic.Volume = 0

local LoadTime = 45

LoadBar:TweenSize(UDim2.new(1,0,1,0),"Out","Quad",LoadTime)

wait(LoadTime)

for i = 0,1,.1 do

LoadingText.TextTransparency = i

wait(.01)

end

LoadingText.Text = "- Loaded -"

for i = 1,0,-.1 do

LoadingText.TextTransparency = i

wait(.01)

end

for i,v in pairs(MainFrame:GetChildren())do

if v.Name ~= "LoadingGameName" then

if v.Name == "LoadingText" then

v:TweenPosition(UDim2.new(v.Position.X.Scale,v.Position.X.Offset,-1,0),"Out","Quad",2)

else

v:TweenPosition(UDim2.new(v.Position.X.Scale,v.Position.X.Offset,1.5,0),"Out","Quad",2)

end

end

end

for i = 0,1,.1 do

GameNameText.TextTransparency = i

wait(.01)

end

GameNameText.Text = "Welcome to King's Landing!"

for i = 1,0,-.1 do

GameNameText.TextTransparency = i

wait(.01)

end

wait(3)

CutsceneScript.Disabled = false

for i = 0,1,.1 do

GameNameText.TextTransparency = i

wait(.01)

end

Music:Play()

wait(.2)

MainFrame.Visible = false

Menu.Visible = true

wait(5)

Menu.PlayButton.Visible = true

for i = 1,0,-.01 do

Menu.PlayButton.TextTransparency = i

Menu.PlayButton.BackgroundTransparency = i

end

PlayButton.MouseButton1Down:connect(function()

local Camera = game.Workspace.CurrentCamera

Menu:TweenPosition(UDim2.new(.5,0,-1,0),"Out","Quad",2)

wait(2.5)

Blur:Destroy()

CutsceneScript:Destroy()

Camera.CameraType = Enum.CameraType.Custom

Camera.CameraSubject = Player.Character.Humanoid

Camera.FieldOfView = 70

game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack,true)

game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Health,true)

game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat,true)

PlayerGui:SetTopbarTransparency(.5)

for i = 1,0,-.01 do

Music.Volume = i

wait(.01)

end

for i = 0, .2,.01 do

GameMusic.Volume = i

wait(.01)

end

wait(1)

LoadingScreen:Destroy()

Interface.Enabled = true

end)

Can a mod merge this with the OPs other post?