Trouble with cutscenes

So I have an idea where if something hits one part, it will update the entire server’s camerasubject to a certain part and will follow the part with CFrame, using a remote-event. It hits another part, and it returns all the camerasubjects back to their respective humanoids.

(Script for the part that activates the remoteevent.)
image

I tried this here, very similar to Alvinblox’ cutscene tutorial where it uses remote events.


There are problems with this that I cannot seem to think of a solution for and I was wondering if anybody could help.

Problems like:
No errors would show up in output so I’d get nothing
Because of the constant setting of the CFrame of the camera to the part, trying to do a wait(4) and disabling that function I couldn’t figure out how to do.
This will work into setting the camera at the start, but I never got it to return.

Thanks in advance

Can you copy and paste the code instead of screenshots?

Connecting a Heartbeat event loop inside of an OnClientEvent/OnServerEvent connection is ill-advised. You’ll be creating new Heartbeat loops each time the RemoteEvent is fired.

Once you disable the script, the script stops. Nothing further happens, thus the script stays disabled forever. Because of this, you shouldn’t use script.Disabled = true as this is most likely what’s causing it to set the camera once at the start and then never return. It’s also most likely why you receive no output as when the script isn’t running, there’s no error to give. You should instead make use of a debounce. This makes it to where the function can only be triggered once it’s done!

A debounce works like this. Try replacing your first code with it and let us know if anything is different.

local debounce = false -- this is the debounce
game.Workspace.TrainWatchActivate.Touched:Connect(function()
    if debounce == false then
        debounce = true
        game.ReplicatedStorage.TrainWatchStop:FireAllClients()
        wait(4)
        game.StarterGui.TrainWatch.Enabled.Value = false
        wait(2000)
        debounce = false
    end
end)
1 Like

Thanks although it is still broken. I’ll keep trying.