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

how do i make this cutscene play when a part is touched?

i'm using a cutscene plugin by badlydev/beez_up and theres an option to 'play cutscene once when a part is touched' but it just puts the script into replicatedfirst so i'm not sure how to get it to play when a part is touched?

		local data = {{CFrame = CFrame.new(-163.386337, 9.12168503, 86.5627747, -0.190807536, -0.0414887182, 0.980750322, -0, 0.999106526, 0.0422652364, -0.981627524, 0.0080645252, -0.190637022);Seconds = 1.5;Style = Enum.EasingStyle.Sine},{CFrame = CFrame.new(-170.23143, 9.03917599, 87.2517471, -0.0453640521, -0.000388695713, 0.998970389, -0, 0.999999881, 0.000389096298, -0.998970509, 1.76509839e-05, -0.0453640483);Seconds = 1.5;Style = Enum.EasingStyle.Sine}}
		local camera = workspace.CurrentCamera
		local part = game.Workspace:WaitForChild('153211')
		local tween = game:GetService("TweenService")
		local deb = false
		part.Touched:Connect(function(hit)
			if hit.Parent:FindFirstChild"Humanoid" then
			if deb == false then
			deb = true
			for i,v in pairs(data) do
			tween:Create(
				camera,
				TweenInfo.new(
				v.Seconds,
				v.Style,
				Enum.EasingDirection.Out,
				0,
				false,
				0
				),
			{CFrame = v.CFrame}
		):Play()
		wait(v.Seconds)
		end
			end
			end
		end)

1 comment

0

What do you mean when it "puts the script into replicatedfirst"?

1 answer

✓ Accepted answer

It is FindFirstChild("Humanoid") not FindFirstChild"Humanoid"

local data = {{CFrame = CFrame.new(-163.386337, 9.12168503, 86.5627747, -0.190807536, -0.0414887182, 0.980750322, -0, 0.999106526, 0.0422652364, -0.981627524, 0.0080645252, -0.190637022);Seconds = 1.5;Style = Enum.EasingStyle.Sine},{CFrame = CFrame.new(-170.23143, 9.03917599, 87.2517471, -0.0453640521, -0.000388695713, 0.998970389, -0, 0.999999881, 0.000389096298, -0.998970509, 1.76509839e-05, -0.0453640483);Seconds = 1.5;Style = Enum.EasingStyle.Sine}}
local camera = workspace.CurrentCamera
local part = game.Workspace:WaitForChild('153211')
local tween = game:GetService("TweenService")
local deb = false
part.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
    if deb == false then
    deb = true
    for i,v in pairs(data) do
    tween:Create(
        camera,
        TweenInfo.new(
        v.Seconds,
        v.Style,
        Enum.EasingDirection.Out,
        0,
        false,
        0
        ),
    {CFrame = v.CFrame})
tween:Play()
wait(v.Seconds)
end
    end
    end
end)

2 comments

0

oh, interesting. that fixed it! not sure why the script was like that, thanks!

0

In your original script, you didn't play the tween you just did :Play() so I corrected that as well, glad its working fine!

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