Hello, I made a basic notification system, however, I’m having an issue when notifications are sent. I’m not really sure how to explain the bug I am having, but it is visible in the top right corner in the game L7_M's Place Number: 201 - Roblox (I made it so the notifications keep popping up so you can see the bug.)
Like how should I make it so the notifications don’t leave gaps or overlap? I’m completely stumbled by this. (I know the notifications aren’t synced up to when someone joins, I currently just have them play every second while I test it)
Script
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Folder = ReplicatedStorage:WaitForChild("Notifications")
local Event = Folder:WaitForChild("SetEvent")
local MainFrame = script.Parent
local AlarmFrame = script:WaitForChild("Alarm")
local KillDieFrame = script:WaitForChild("KillDie")
local JoinLeaveFrame = script:WaitForChild("JoinLeave")
local BanFrame = script:WaitForChild("Ban")
local FrameCount = 0
local function UpdateFrames()
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
print(v.Position.Y.Scale)
local Places = 3
local Mult = 10^3
local alt = math.floor(v.Position.Y.Scale*Mult)/Mult
print(alt)
if v.Position.Y.Scale <= 0.05 then
v:Destroy()
FrameCount = FrameCount - 1
else
v:TweenPosition(UDim2.new(0, 0, Set-.075, 0), 'Out', 'Quart', 1)
end
end
end
end
Event.OnClientEvent:Connect(function(Type, Arg)
if Type == "Joined" then
local Cloned = JoinLeaveFrame:Clone()
local Position = FrameCount*.075
Cloned.Position = UDim2.new(1, 0, Position, 0)
FrameCount = FrameCount + 1
Cloned.Parent = MainFrame
Cloned:TweenPosition(UDim2.new(0, 0, Position, 0), 'Out', 'Quart', 1)
end
end)
while wait(3) do
UpdateFrames()
end