Hello, I’m making a notification system. Currently, I have a local script:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Folder = ReplicatedStorage:WaitForChild("Notifications")
local Event = Folder:WaitForChild("SetEvent")
local MainFrame = script.Parent
local AlarmFrame = MainFrame:WaitForChild("Alarm")
local KillDieFrame = MainFrame:WaitForChild("KillDie")
local JoinLeaveFrame = MainFrame:WaitForChild("JoinLeave")
local BanFrame = MainFrame:WaitForChild("Ban")
local FrameCount = 0
Event.OnClientEvent:Connect(function(Type, Arg)
if Type == "Joined" then
local Cloned = JoinLeaveFrame:Clone()
Cloned:TweenPosition(UDim2.new(0.35, 0, .2, 0), 'Out', 'Quart', 1)
FrameCount = FrameCount + 1
end
end)
while wait(3) do
for i,v in pairs(MainFrame:GetChildren()) do
if v.Name == "Alarm" or v.Name == "KillDie" or v.Name == "JoinLeave" or v.Name == "Ban" then
local Set = v.Position.Y.Scale
if v.Position.Y.Scale == 0 then
v:Destroy()
FrameCount = FrameCount - 1
else
v:TweenPosition(UDim2.new(0, 0, Set-.075, 0), 'Out', 'Quart', 1)
end
end
end
end
Basically, I have four frames currently visible on the notification system. Every 3 seconds, each frame moves up by -.075, and if it is already at the top then it is deleted. The issue I have is, when they move up the first time, the frame at the very top is deleted (as it should), however at the next rotation, the frame that is at v.Position.Y.Scale == 0 does not delete, but rather is moved up again, pushing it outside of its boundaries. It works correctly for the first rotation, but the second rotation it is not deleted. Does anyone know why this might be?