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

New Update to roblox with LoadLibrary is Messing up My cutscene Local script?

Asked by 4 years ago

The New Post by a Roblox staff said that LoadLibrary will be gone due to It not been updating right. More info: (https://devforum.roblox.com/t/loadlibrary-is-going-to-be-removed-on-december-4th/382516)

With that post he said to add

local RbxUtility = require(game:GetService("ReplicatedStorage"):
    WaitForChild("LoadLibrary"):WaitForChild("RbxUtility"))

So with that script I did what the roblox staff Member said and did

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

local c = game.Workspace.CurrentCamera
local RbxUtility = require(game:GetService("ReplicatedStorage"):
    WaitForChild("LoadLibrary"):WaitForChild("RbxUtility"))
local data = RbxUtility = require(game:GetService("ReplicatedStorage"):
    WaitForChild("LoadLibrary"):WaitForChild("RbxUtility")) .DecodeJSON(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()

with that script.

But with what he said to do It seems to not work. Did I do something wrong?

1 answer

Log in to vote
0
Answered by 4 years ago
local RbxUtility = require(game:GetService("ReplicatedStorage"):WaitForChild("LoadLibrary"):WaitForChild("RbxUtility"))
local data = RbxUtility = require(game:GetService("ReplicatedStorage"):WaitForChild("LoadLibrary"):WaitForChild("RbxUtility"))

You don't need the second variable. Change anything that uses data to use RbxUtility.

0
Ok thank you! iowhjmmjjm 7 — 4y
0
Just did what you said and now the screen just stays in only one place. iowhjmmjjm 7 — 4y
0
Are there any errors? Ethan_Waike 156 — 4y
0
Oh, I'm sorry, I failed to realize that `local data` is extended to include .DecodeJSON(script.CutsceneData.Value). Add this to the end of the RbxUtility variable and it should solve your issue. Ethan_Waike 156 — 4y
View all comments (3 more)
0
So say this: local data = RbxUtility = .DecodeJSON(script.CutsceneData.Value) ??? iowhjmmjjm 7 — 4y
0
Im sorry. I'm new to scripting iowhjmmjjm 7 — 4y
0
Nvm! iowhjmmjjm 7 — 4y
Ad

Answer this question