I’ve been trying to create a News Ticker type effect for about 2 hours now, but I’m not sure how.
The image below shows what I’ve been trying to create:
Though here are the results of this:
I’m not sure what the issue with the script entirely is, but pointing the obvious out, the images are not following each other in order nor moving in unison.
I’ve tried to search this up multiple times on the DevForum and Reddit which I could barely find any posts related to this since News Tickers aren’t as in demand.
ModuleScript:
local textModule = {}
local PlayersService = game:GetService("Players")
local TweenService = game:GetService("TweenService")
local RunService = game:GetService("RunService")
local DebrisService = game:GetService("Debris")
local waitTime = 8
local runTime = 1
local function convertText(text)
return string.upper(text)
end
local function typewrite(label1, label2, text, delay)
for i = 1, #text do
label1.MaxVisibleGraphemes = i
label2.MaxVisibleGraphemes = i
task.wait(delay)
end
end
function textModule:new(player, colorScheme, text)
if not (player and colorScheme and text) or type(text) ~= "string" then return end
local plrGui = player:FindFirstChild("PlayerGui")
if not plrGui then return end
local templateUI = script:WaitForChild("PhaseUI")
local templateImage = script:WaitForChild("TemplateImage")
templateImage.Inner.ImageColor3 = colorScheme
local UI = templateUI:Clone()
UI.Parent = plrGui
local CanvasGroup = UI:WaitForChild("GroupedFrame")
local Frame = CanvasGroup:WaitForChild("MainFrame")
local ConveyorFrameLeft = CanvasGroup:WaitForChild("UpperToLeft")
local ConveyorFrameRight = CanvasGroup:WaitForChild("LowerToRight")
local Text = Frame.MainText
local Text2 = Text.ActualText
CanvasGroup.GroupColor3 = Color3.new(0, 0, 0)
CanvasGroup.GroupTransparency = 1
Frame.BackgroundColor3 = colorScheme
TweenService:Create(CanvasGroup, TweenInfo.new(0.35, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut), {
GroupColor3 = Color3.new(1,1,1),
GroupTransparency = 0
}):Play()
local upperText = convertText(text)
typewrite(Text, Text2, upperText, 0.05)
local function startConveyor(conveyorFrame)
local templateSize = templateImage.Size.X.Scale
local spacing = 0.05
local clones = {}
local function clone()
local clone = templateImage:Clone()
clone.Parent = conveyorFrame
clone.Position = UDim2.fromScale(1,0)
clone.ImageTransparency = 0
table.insert(clones, clone)
end
for i = 1, 3 do
clone()
end
local function resetPosition(clone)
clone.Position = UDim2.fromScale(1,0)
end
local function updateLabels(dt)
for i, clone in ipairs(clones) do
clone.Position = clone.Position - UDim2.fromScale(dt / runTime, 0)
if clone.Position.X.Scale <= -templateSize then
resetPosition(clone)
clone()
end
-- wait a bit
task.wait(0.05)
end
end
RunService.RenderStepped:Connect(updateLabels)
end
task.spawn(function()
startConveyor(ConveyorFrameLeft)
end)
task.spawn(function()
startConveyor(ConveyorFrameRight)
end)
task.wait(7.25)
TweenService:Create(CanvasGroup, TweenInfo.new(0.35, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut), {
GroupColor3 = Color3.new(0,0,0),
GroupTransparency = 1,
Size = UDim2.fromScale(1.2,1.2)
}):Play()
DebrisService:AddItem(UI, waitTime)
end
return textModule