Context: I am using a UIListLayout.
So I’m working on a radio, and everything is done, (All events work, all that jazz) it’s just that I don’t really know what to do about the messages staying within the frame.
There are 2 issues that need to be fixed.
- The radio messages going off the screen.
Example of what I want:
Example of what’s happening: - I want the message to start from the top, and push the other messages down, which at the moment, isn’t possible with a UIListLayot, (Don’t know of alternatives.)
Okay, moving on: I attempted to use AbsolutePosition to remove the messages with my Local Script:
local MessageEvent = game.ReplicatedStorage.SendMessageToAll
local MessageFrame = script.Parent.MessageFrame
local Format = MessageFrame.Format
MessageEvent.OnClientEvent:Connect(function(plr, msg, color)
local NewMessage = Format:Clone()
NewMessage.Parent = MessageFrame
NewMessage.TextColor3 = color
NewMessage.Text = plr.Name .. " - " .. msg
NewMessage.Visible = true
for i,v in pairs(MessageFrame:GetChildren()) do
if v:IsA("TextLabel") then
if v.AbsolutePosition.Y >= 360 then
v:Destroy()
end
end
end
end)
And this method doesn’t work at the moment because AbsolutePosition changes with screen resolution, essentially nullifying this method.
So if you have any way to help me, that’d be greatly appreciated.