What do i replace LoadLibrary with?

I opened silent dark willing to fix it but came over this and couldn’t find a solution to this loadlibrary error
Do any of you know how to replace this?

local c = game.Workspace.CurrentCamera
local data = LoadLibrary("RbxUtility").DecodeJSON(script.CutsceneData.Value)
local rs = game:GetService("RunService").RenderStepped
1 Like

LoadLibrary was deprecated and removed a while back, they provided a replacement inside of this forum.

1 Like

will it work in this scenario (Cutscene camera)

I’m honestly not sure, I have not used LoadLibrary enough to tell you, sorry.

The code is supposed to read a .json code providing position info.

You can use HttpService:JSONDecode as a replacement

1 Like

this is the script im fixing:

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

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

function tweenCam(c1,f1,time,fov,roll)
	local c0,f0,fv0,r0,frames = c.CoordinateFrame,c.Focus,c.FieldOfView,c:GetRoll(),time/0.015
	for i = 1,frames do
		c.CameraType = "Scriptable"
		c.CoordinateFrame = CFrame.new(c0.p:lerp(c1.p,i/frames),f0.p:lerp(f1.p,i/frames))
		c.FieldOfView = (fv0+(fov-fv0)*(i*(1/frames)))
		c:SetRoll(r0+(roll-r0)*(i*(1/frames)))
		rs:wait()
	end
end

print("Running")
c.CameraSubject = nil	
c.CameraType = "Scriptable"
c.CoordinateFrame = CFrame.new(unpack(data[1].c1))
c.Focus = CFrame.new(unpack(data[1].f1))
c.FieldOfView = data[1].FOV
c:SetRoll(data[1].Roll)
if script:findFirstChild("SkipCutsceneGuiValue") then
	local gui = script.SkipCutsceneGui:clone()
	gui.Parent = game.Players.LocalPlayer.PlayerGui
	gui.Cutscene.Value = script
	gui.Main.Debug.Disabled = false
	script.SkipCutsceneGuiValue.Value = gui
end
for i = 2,#data do
	tweenCam(CFrame.new(unpack(data[i].c1)),CFrame.new(unpack(data[i].f1)),data[i].step,data[i].FOV,data[i].Roll)
end
c.CameraSubject = game.Players.LocalPlayer.Character.Humanoid	
c.CameraType = "Custom"
c.FieldOfView = 70
if script:findFirstChild("SkipCutsceneGuiValue") then
	if script.SkipCutsceneGuiValue.Value ~= nil then
		script.SkipCutsceneGuiValue.Value:Destroy()
	end
end
script:Destroy()

i put in httpservice btw as you said earlier

still not working
did exactly what u said

Are there any errors in the output?

“Workspace.sizquirt.CutsceneScript:4: attempt to index nil with ‘JSONDecode’ - Client - CutsceneScript:4”

You need to define HttpService

2 Likes

What do you mean define?
I’m not the best of scripting.

Put

local HttpService = game:GetService("HttpService")

at the top of the script

1 Like

It works!!! Thank you so much!-