CutsceneService

CutsceneService

by Speedetoon - Roblox

Link:

Roblox asset store: https://create.roblox.com/store/asset/107702102941172/CutsceneService

If your a new beginner or a super expert at coding, this module can help you ether way. if your struggling or ant help, here is a example code

local CutsceneService = require(script.Parent.CutsceneService)

task.wait(5) -- Makes sure the player has loaded in

local cutscene = CutsceneService:create("myCutscene", function(CutsceneConfig, name) -- name of the cutscene and function (the function table which you make the cameras and so on. the name of the cutscene)
	local camera = CutsceneConfig:addCamera(CFrame.new(10, 10, 10), "Tween", 70, 2, Enum.EasingStyle.Sine) -- EndCframe/destination, cameraType/Transition, FOV/field of view, length
	
	camera:play() -- this function plays the camera changes
	camera.Completed:Wait() -- waits until the camera is done transiting
	
	local npc = CutsceneConfig:createNpc(workspace.Rig)
	npc:playAnimation(16709557386)
	
	task.wait(2)
	
	-- to finish it we are gonna use this function
	CutsceneConfig:finalize()
end)

cutscene:execute() -- makes the cutscene fire

To start of of, you need to require the module:

local CutsceneService = require(script.Parent.CutsceneService)

Then, to create the cutscene we need to use the create function:

CutsceneService:create("myFunction", function(CutsceneConfig, name)
	
end)

This takes in 2 arguments: the name, and the and a function.
The function takes also in 2 arguments: the cutscene config, and the name you choose (just in case)

Now, to execute the cutscene we made we can do this:

CutsceneService:create("myFunction", function(CutsceneConfig, name)
	
end):execute()

Or this:

local cutscene = CutsceneService:create("myFunction", function(CutsceneConfig, name)
	
end)

cutscene:execute()

The cutscene config has 3 functions:

  1. addCamera

CutsceneConfig:addCamera(CFrame.new(10, 10, 10), β€œFade”, 70, 2, Enum.EasingStyle.Sine) – The destination, the cameraType, the FOV (Field of view), The length (Is not used in the instant cameraType), easingStyle and easingDirection (optional for both the Fade, and the Tween)

  1. createNpc

CutsceneConfig:createNpc(workspace.Rig) – Takes the npc you want to add

  1. finalize

CutsceneConfig:finalize – Finishes it

addCamera has two things you can index it. The first one is

camera:play() -- Plays the camera animation which you set when creating a camera (CameraType)

The second one is

camera.Completed:Wait() -- Yields until camera animation is completed

The createNpc has one function:

npc:playAnimation(animationId) -- Takes in an animation ID

And the last function in the CutsceneConfig is the finialize
The finalize finishes up the cutscene

The last function it has is

 CutsceneService:eliminate(name) -- The name of the cutscene
1 Like

Sorry, the last post got moderated for some issues with it. I think all is fixed now!

1 Like