I am trying to make a script in which if a notification is sent it moves another notification up. I already had it so the new notification goes to top but that didn’t work for me. This is the code I wrote so far.
local tweenservice = game:GetService("TweenService")
game.ReplicatedStorage.Announcer.OnClientEvent:Connect(function(text,color,title)
for i,v in pairs(script.Parent.List:GetChildren()) do
if v:IsA("Frame") then
local YPos = v.Position.Y-1.2
tweenservice:Create(v.Position,TweenInfo.new(.5,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,0,false,0),{Y = UDim.new(YPos,0)}):Play()
end
end
local clone = script.Notification:Clone()
clone.Parent = script.Parent.List
clone.Position = UDim2.new(1.05,0,0,0)
clone.Title.Text = title
clone.Info.Text = text
clone.i.ImageColor3 = color
clone.Divider.BackgroundColor3 = color
clone.Background.BackgroundColor3 = color
game.Workspace.Game.Sounds.UIsounds.Notification.TimePosition = 0.5
game.Workspace.Game.Sounds.UIsounds.Notification:Play()
tweenservice:Create(clone,TweenInfo.new(.5,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,0,false,0),{Position = UDim2.new(0,0,0,0)}):Play()
wait(5)
tweenservice:Create(clone,TweenInfo.new(.5,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,0,false,0),{Position = UDim2.new(1.05,0,0,0)}):Play()
wait(1)
clone:Destroy()
end)
but for now focus on the for i,v in pairs(script.Parent.List:GetChildren()) do if v:IsA("Frame") then local YPos = v.Position.Y-1.2 tweenservice:Create(v.Position,TweenInfo.new(.5,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,0,false,0),{Y = UDim.new(YPos,0)}):Play() end end
because that’s where I am having issues. In the console there is an error that goes like:
Please help