Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

error in CloneTrooper Cutscene Editor causing me problems, please help explain whats wrong?

Hello, i am using the CloneTrooper Cutscene Editor Plugin to make cutscenes for a game i'm making, and usually it would work fine and not give me any problems, but today i've been trying to get the local script generated by the plugin to play the actual cutscene, but, when i try to play it , it gives me an error saying [DataFromCutscene is not a valid member of LocalScript] now, in the local script it generates a camera, then tells a camera to go on a path which is gathered from a string, this string has values cframes telling the camera where to go, but thats not my problem. The problem is that when the local script is ran, roblox can't find the string, even thought it is still there, the code i am using says

local HttpService = game:GetService("HttpService")
local data = HttpService:JSONDecode(script.DataFromCutscene.Value)

local c = game.Workspace.CurrentCamera
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()

now, in the second line of the code it says [local data = HttpService:JSONDecode(script.DataFromCutscene.Value)] which is getting the actual local script, getting the value of the the string, and i've check that this works and it does, i've even checked with a simpler script like [local data = script.DataFromCutscene.Value] but i still get the same error, and i'm new to scripting so i don't really understand alot, this is one of the things i don't understand, so can someone please explain to me what is wrong with script and how to fix it

1 answer

local data = HttpService:JSONDecode(script:WaitForChild("DataFromCutscene").Value)

Since the custscene editor disables the script until the player joins, you have to use WaitForChild.

1 comment

0

Overall the cutscene editor is just broken.

This discussion is preserved as it was. New answers, comments, and votes are closed.