Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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)

1 comment

0

I'm poofed

1 answer

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)

3 comments

0

This is probably a dumb question, but where do I put it?

0

oh nevermind lol

0

could u atleast give me an upvote :C

This discussion is preserved as it was. New answers, comments, and votes are closed.