I’m trying to make it so whenever pressed is true the loop instantly stops even with the waits, I’ve tried using break, but it only does it at the end and I also tried using a for i= 1, second loop and it still doesnt work.
while pressed == false do
target = oresfall.One
--TweenService:Create(oresfall.One, TweenInfo.new(0.1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0), {CFrame = CFrame.new(oresfall.One.Position, Vector3.new(oresfall.One.Position.X, oresfall.Two.Position.Y, oresfall.One.Position.X))}):Play()
TweenService:Create(oresfall.One, TweenInfo.new(10, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut), {
CFrame = oresfall.Two.CFrame
}):Play()
wait(10)
TweenService:Create(oresfall.One, TweenInfo.new(5, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut), {
CFrame = oresfall.Three.CFrame
}):Play()
wait(3.5)
local logo = script.Parent.Logo
TweenService:Create(logo, TweenInfo.new(.5, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut), {
ImageTransparency = 0
}):Play()
TweenService:Create(logo, TweenInfo.new(5, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut), {
Size = UDim2.new(0, 639,0, 427)
}):Play()
wait(2)
TweenService:Create(logo, TweenInfo.new(1, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut), {
ImageTransparency = 1
}):Play()
local Menu = script.Parent.Parent.Menu
TweenService:Create(Menu, TweenInfo.new(1, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut), {
BackgroundTransparency = 0
}):Play()
wait(1)
local Menu = script.Parent.Parent.Menu
TweenService:Create(Menu, TweenInfo.new(0.5, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut), {
BackgroundTransparency = 1
}):Play()
oresfall.One.Position = originalpos
target = Heart.One
TweenService:Create(Heart.One, TweenInfo.new(10, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut), {
CFrame = Heart.Two.CFrame
}):Play()
TweenService:Create(Heart.One, TweenInfo.new(5, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut), {
CFrame = Heart.Three.CFrame
}):Play()
wait(5)
TweenService:Create(Menu, TweenInfo.new(1, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut), {
BackgroundTransparency = 0
}):Play()
wait(1)
TweenService:Create(Menu, TweenInfo.new(0.5, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut), {
BackgroundTransparency = 1
}):Play()
Heart.One.Position = originalpos2
end
end)