I need this cut scene script to only run on player join, but it currently also runs on respawn....
All parts/code is valid and working except for the stated reason
player = script.Parent.Parent char = player.Character cam = game.Workspace.CurrentCamera char.Humanoid.WalkSpeed = 0 game.Workspace.CurrentCamera.CameraType = "Scriptable" wait() local Players = game:GetService("Players") game.Workspace.CurrentCamera.CameraType = "Track" intro = game.Workspace.Intro pos1 = intro.IntroCam1 pos2 = intro.pos2 pos3 = intro.Pos3 pos4 = intro.Pos4 pos5 = intro.Pos5 pos6 = intro.Pos6 pos7 = intro.Pos7 endpos = intro.EndPos function onPlayerAdded() game.Workspace.CurrentCamera.CameraType = "Scriptable" char.Humanoid.WalkSpeed = 0 game.Workspace.CurrentCamera:Interpolate(CFrame.new(pos1.Position),CFrame.new(pos1.Rotation),2) wait(2) game.Workspace.CurrentCamera:Interpolate(CFrame.new(pos2.Position),CFrame.new(pos2.Rotation),3) wait(3) game.Workspace.CurrentCamera:Interpolate(CFrame.new(pos3.Position),CFrame.new(pos3.Rotation),1) wait(1) game.Workspace.CurrentCamera:Interpolate(CFrame.new(pos4.Position),CFrame.new(pos4.Rotation),5) wait(5) game.Workspace.CurrentCamera:Interpolate(CFrame.new(pos5.Position),CFrame.new(pos5.Rotation),3) wait(3) game.Workspace.CurrentCamera:Interpolate(CFrame.new(pos6.Position),CFrame.new(pos6.Rotation*90),5) wait(5) game.Workspace.CurrentCamera:Interpolate(CFrame.new(pos7.Position),CFrame.new(pos7.Rotation),3.5) wait(3.5) game.Workspace.CurrentCamera:Interpolate(CFrame.new(pos7.Position),CFrame.new(pos7.Rotation),1.5) wait() char.Humanoid.WalkSpeed = 16 game.Workspace.CurrentCamera.CameraType = "Track" end for _,player in pairs(Players:GetPlayers()) do onPlayerAdded() end
Connect a function to OnPlayerAdded. This makes it run when a player joins.
player = script.Parent.Parent char = player.Character cam = game.Workspace.CurrentCamera char.Humanoid.WalkSpeed = 0 game.Workspace.CurrentCamera.CameraType = "Scriptable" wait() local Players = game:GetService("Players") game.Workspace.CurrentCamera.CameraType = "Track" intro = game.Workspace.Intro pos1 = intro.IntroCam1 pos2 = intro.pos2 pos3 = intro.Pos3 pos4 = intro.Pos4 pos5 = intro.Pos5 pos6 = intro.Pos6 pos7 = intro.Pos7 endpos = intro.EndPos function onPlayerAdded() game.Workspace.CurrentCamera.CameraType = "Scriptable" char.Humanoid.WalkSpeed = 0 game.Workspace.CurrentCamera:Interpolate(CFrame.new(pos1.Position),CFrame.new(pos1.Rotation),2) wait(2) game.Workspace.CurrentCamera:Interpolate(CFrame.new(pos2.Position),CFrame.new(pos2.Rotation),3) wait(3) game.Workspace.CurrentCamera:Interpolate(CFrame.new(pos3.Position),CFrame.new(pos3.Rotation),1) wait(1) game.Workspace.CurrentCamera:Interpolate(CFrame.new(pos4.Position),CFrame.new(pos4.Rotation),5) wait(5) game.Workspace.CurrentCamera:Interpolate(CFrame.new(pos5.Position),CFrame.new(pos5.Rotation),3) wait(3) game.Workspace.CurrentCamera:Interpolate(CFrame.new(pos6.Position),CFrame.new(pos6.Rotation*90),5) wait(5) game.Workspace.CurrentCamera:Interpolate(CFrame.new(pos7.Position),CFrame.new(pos7.Rotation),3.5) wait(3.5) game.Workspace.CurrentCamera:Interpolate(CFrame.new(pos7.Position),CFrame.new(pos7.Rotation),1.5) wait() char.Humanoid.WalkSpeed = 16 game.Workspace.CurrentCamera.CameraType = "Track" end game.Players.PlayerAdded:connect(OnPlayerAdded)
You have it running for each and every player at once. Instead, connect the function!
At the bottom, put this:
game.Players.PlayerAdded:connect(onPlayerAdded)