I use the following code to trigger a cutscene animation as soon as a player joins the game:
local cams = workspace:WaitForChild("Cameras")
local cam = workspace.CurrentCamera
local tweenService = game:GetService("TweenService")
wait(5)
cam.CameraType = Enum.CameraType.Scriptable
for i, camPart in pairs(cams:GetChildren()) do
local tweenInfo = TweenInfo.new(2, Enum.EasingStyle.Quint, Enum.EasingDirection.InOut)
local goal = {CFrame = cams[i].CFrame}
local tweenToNextCamera = tweenService:Create(cam, tweenInfo, goal)
tweenToNextCamera:Play()
tweenToNextCamera.Completed:Wait()
end
cam.CameraType = Enum.CameraType.Custom
Is there any way to do the same function but instead it triggers when a player touches a block?

1 comment
u can use a remote event to tell the client to play it or you can just detect the hits on the server