Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is my skip button not disabling my cutscene local script?

Asked by 2 years ago

Hey Developers!

I've made a cutscene that plays local to a player whenever a player joins the game, if they reset their character the camera remains in the same position, I'm trying to make it so when they press the "Skip Button" (which is actually the play button) for the cutscene to stop remaining in the same position and move back to the player's default camera state. I'm also want for the player to spawn on a spawn location after pressing the play button. Here is the local script for the camera cutscene: Thank you in advance

local TweenService = game:GetService("TweenService") local camera = game.Workspace.Camera local PlayButton = script.Parent local cutsceneTime = 3 --this will change the length of your cutscene in seconds 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()

PlayButton.MouseButton1Down:Connect(function()
    camera.CameraType = Enum.CameraType.Custom
end)    

end

wait()

tween(Workspace.Test1, Workspace.Test2)

0
I'm poofed Roblox28721 10 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago

local tween = TweenService:Create(camera, tweenInfo, {CFrame = part2.CFrame}) tween:Play()

PlayButton.MouseButton1Click:Connect(function() -- Its Supposed To be MouseButton1Click

camera.CameraType = Enum.CameraType.Custom end)

0
This is probably a dumb question, but where do I put it? Roblox28721 10 — 2y
0
oh nevermind lol Roblox28721 10 — 2y
0
could u atleast give me an upvote :C Verbalase_notreal 23 — 2y
Ad

Answer this question