[Intro/Help needed] Tween Issues

I am trying to make a game intro with a moving background.

I am having issues making this script loop Please help.

Code

local CurrentCamera = workspace.CurrentCamera

local TweenService = game:GetService("TweenService")
local Players = game:GetService("Players")

local Label = script.Parent.Top.TextLabel
local BackFrame = script.Parent.Back
local TopFrame = script.Parent.Top
local Headshot = TopFrame.ImageLabel

local play = game.Players.LocalPlayer.play.Value
print(play)
local plrName = game.Players.LocalPlayer
local Id = game.Players.LocalPlayer.UserId
while play == false do
	repeat
		local Text1 = "343434242"
		local Text2 = "343434242"
		local Text3 = "343434242"
		local Text4 = "343434242"
		local Text5 = "343434242"
		local Text6 = "343434242"
		local Text7 = "343434242"


		local plrname = workspace.yourname.Value
		print(plrname)
		script.Parent.Enabled = true	

		CurrentCamera.CameraType = Enum.CameraType.Scriptable
		CurrentCamera.CameraSubject = workspace.TextFocus1
		CurrentCamera.CFrame = workspace.TextFocus1.CFrame

		local thumbType = Enum.ThumbnailType.HeadShot
		local thumbSize = Enum.ThumbnailSize.Size420x420
		local content, isReady = Players:GetUserThumbnailAsync(Id, thumbType, thumbSize)

		TopFrame.Visible = true
		BackFrame.Visible = true
		Headshot.Image = content

		local StageTweenInfo = TweenInfo.new(5, Enum.EasingStyle.Linear, Enum.EasingDirection.In)
		local StageGoal = {CFrame = workspace.TextFocus2.CFrame}
		local StageTween = TweenService:Create(CurrentCamera, StageTweenInfo, StageGoal)

		StageTween:Play()
		for i = 1, #Text1 do
			Label.Text = string.sub(Text1, 1, i)
			wait(.045)
		end

		CurrentCamera.CameraSubject = workspace.TextFocus3
		CurrentCamera.CFrame = workspace.TextFocus3.CFrame

		local StageGoal2 = {CFrame = workspace.TextFocus4.CFrame}
		print("change")
		local StageTween2 = TweenService:Create(CurrentCamera, StageTweenInfo, StageGoal2)
		StageTween2:Play()

		wait(2.5)

		for i = 1, #Text2 do
			Label.Text = string.sub(Text2, 1, i)
			wait(.045)
		end

		CurrentCamera.CameraSubject = workspace.TextFocus5
		CurrentCamera.CFrame = workspace.TextFocus5.CFrame

		local StageGoal3 = {CFrame = workspace.TextFocus6.CFrame}
		print("change")
		local StageTween3 = TweenService:Create(CurrentCamera, StageTweenInfo, StageGoal3)
		StageTween3:Play()

		wait(2.5)

		for i = 1, #Text3 do
			Label.Text = string.sub(Text3, 1, i)
			wait(.045)
		end

		CurrentCamera.CameraSubject = workspace.TextFocus7
		CurrentCamera.CFrame = workspace.TextFocus7.CFrame

		local StageGoal4 = {CFrame = workspace.TextFocus8.CFrame}
		print("change")
		local StageTween4 = TweenService:Create(CurrentCamera, StageTweenInfo, StageGoal4)
		StageTween4:Play()

		wait(2.5)

		for i = 1, #Text4 do
			Label.Text = string.sub(Text4, 1, i)
			wait(.045)
		end
		---------------------------------------------------------------


		CurrentCamera.CameraSubject = workspace.TextFocus9
		CurrentCamera.CFrame = workspace.TextFocus9.CFrame

		local StageGoal5 = {CFrame = workspace.TextFocus10.CFrame}
		print("change")
		local StageTween5 = TweenService:Create(CurrentCamera, StageTweenInfo, StageGoal5)
		StageTween5:Play()

		wait(2.5)

		for i = 1, #Text5 do
			Label.Text = string.sub(Text5, 1, i)
			wait(.045)
		end
		wait(1)
		print(play)
	until play == true
end	

Please get back to me :+1:

Do not define Play with its value, as “play” will not change event if game.Players.LocalPlayer.play Changes, define play as game.Players.LocalPlayer.play and change while play == false do to while play.Value == false do

1 Like

Ok that still didnt make it loop please help me.

did you change until play == false too?

1 Like