So I intend my game opening cutscene to only play once and that be it, The problem I am running into is that whenever respawning, it plays the cutscene again. How can I fix this?
here is a video of it happening @ my cutscene script. robloxapp-20210527-1712212.wmv (3.9 MB)
local TweenService = game:GetService("TweenService")
local camera = workspace.CurrentCamera
local Button = script.Parent
local cutsceneTime = 12
local tweenInfo = TweenInfo.new(
cutsceneTime,
Enum.EasingStyle.Sine,
Enum.EasingDirection.Out,
0,
false,
0
)
local function tween(part1, part2)
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = part1.CFrame
local tween = TweenService:Create(camera, tweenInfo, {CFrame = part2.CFrame})
tween:Play()
wait(cutsceneTime)
Button.Visible = true
Button.MouseButton1Down:Connect(function()
Button.Visible = false
camera.CameraType = Enum.CameraType.Custom
end)
end
wait(4)
tween(game.ReplicatedStorage.CutsceneMap.Cam1, game.ReplicatedStorage.CutsceneMap.Cam2)