How to make a cutsceen only appear once

If you have played loomain legacy you would know they use a lot of cutsceenes.

I have tried using a cutsceen editor plugin and making one myself which did work but I only want it to appear only once even if a player leaves.

I think I have an idea how to do it but I’m not certain.

If anyone has any ideas on how to make it I would appreciate it.

5 Likes

Make an event for the cutscene, for it to only run once, for example if the user joins, they have a local script in their startergui, or starterplayer scripts, and it plays the camera tween, or camera interpolation ( whatever you wanted to use ) and then it only runs once, so you don’t do a while () event, if you’d like an example let me know. You’d need some blocks in the map, and you’d name them to what you want, and your camera would move to that.

Edit;
Not sure if you’re doing it when the player joins, or like a cutscene while a script is happening, but this will work for any case, just paste it in your script ( has to be local ) or use it. I’ll show an example of both.

In a script;

local camera = game.Workspace.CurrentCamera 
local Player = game.Players.LocalPlayer
function cutscene()
camera.CameraType = "Scriptable"
camera.CFrame = game.Workspace.CamPart.CFrame
camera:Interpolate(game.Workspace.CamPart.CFrame, game.Workspace.CamPart2.CFrame, 2)
wait(3)
camera:Interpolate(game.Workspace.CamPart2.CFrame, game.Workspace.CamPart3.CFrame, 2)
wait(3)
camera.CameraType = "Custom"
end
--your code
cutscene()

In this example, we are using the function, and making it so the camera moves to 3 parts. Lets deconstruct it;

We have 3 parts, named CamPart and then the number.

In the code, we are interpolating the players camera

camera:Interpolate(game.Workspace.CamPart.CFrame, game.Workspace.CamPart2.CFrame, 2)

We are interpolating it from the campart you start with to the Campart2,

(game.Workspace.CamPart.CFrame, game.Workspace.CamPart2.CFrame, 2)

The number at the end “2” is actually the time it takes, so in the wait(3) events, you can change it. In this case, it takes 2 seconds for CamPart to interpolate to CamPart2.

here is what it would look like in a startergui;

local camera = game.Workspace.CurrentCamera 
local Player = game.Players.LocalPlayer
camera.CameraType = "Scriptable"
camera.CFrame = game.Workspace.CamPart.CFrame
camera:Interpolate(game.Workspace.CamPart.CFrame, game.Workspace.CamPart2.CFrame, 2)
wait(3)
camera:Interpolate(game.Workspace.CamPart2.CFrame, game.Workspace.CamPart3.CFrame, 2)
wait(3)
camera.CameraType = "Custom"

Let me know if this worked! Hope I could help.

3 Likes

I think you will have to use data store if you only ever want to show it to the character once in the whole time they will play.

Yep I would probs do something like this


CutsceneList = Datastore:GetAsync(key)
CustsceneList = {
Welcome = true
Dying = false




}


CutsceneCheckFunction()
if CustsceneList[CustceneName] == false then
spawn(Cutscene)

end
end

also making a physical list such as a folder within the player would make it easier to modify without using up datastore budget since you can save on player leaving

Yeah the only way I assume, save a value saying if a cutscene triggered yet or not.
You can even utilise this to make it so if a player left while a cutscene was happening it will happen again if he comes back

Would this work if a player touches a part?

You are lacking a method to determine if you have already played the cutscene. The simplest way to do this is to create a variable called CutscenePlayed (or whatever you wish), its value should be false. Before you play the cutscene, you should have an if condition, checking if the variable is true (which would mean the cutscene has already played and we don’t need to play it again. If it’s value is false, the cutscene hasn’t played and we should play it, but also set the variable to true so it doesn’t play again. Here’s a pseudocode example:

if CutscenePlayed then
    -- Play cutscene
    CutscenePlayed = true -- So we know it has already been played
else -- Not necessary, just for explanation 
    print('Has already played')
end

On a side note, please do not create multiple replies to ask the same question. You can address both users in the same post by using @ to mention them.

1 Like

This would work in any case. Just make the part touch local, in starter gui.

Next time, instead of replying almost duplicate posts to separate people, you can @username them in one. Just a tip.