#Chat messages overlay each other
145 messages · Page 1 of 1 (latest)
can I see the script?
is there anything that is supposed to make it move up? or it's just this way?
See that's the thing. Do I HAVE to make the chat display move, or is there a way I can make it delete the previous messages when the most recent chat is displayed?
Almost like a fade out
do you want it to move up or just fade?
Just fade out
It’s parented to the frame of the ScreenGui
Alright, Editing the script
Alright, no rush. I appreciate the assistance.
** You are now Level 2! **
Can I see the AvatarChatDisplayHUD children to make the fade part more accurate?
This, correct?
yeah it's good
Alrighty
Alright
oh wait there is a typo in it
in this part of the code:
if chatScrollBox:FindFirstChild("AvatarChatDisplayHUD") then
i wrote AvatarChatDisplatHUD, change it to AvatarChatDisplayHUD
So, I tested that one and it only displays the first message.
I'm not sure if it's a GUI thing I'm missing. Would it be easier for me to record and send a video of what I have?
Errors?
No errors then
did you change it?
I did, yes.
ooh
if chatScrollBox:FindFirstChild("AvatarChatDisplayHUD") then
local chatmessage = chatScrollBox.AvatarChatDisplayHUD
for i, k in pairs(chatmessage:GetDescendants()) do
if k:IsA("GuiObject") then
if k:IsA("ImageLabel") or k:IsA("ImageButton") then
local BackG = TweenService:Create(k, TwInfo, {BackgroundTransparency = 1})
local Image = TweenService:Create(k, TwInfo, {ImageTransparency = 1})
Image:Play()
if k:IsA("Frame") or not k:IsA("Frame") then
BackG:Play()
end
end
if k:IsA("GuiButton") then
local TextAndBack = TweenService:Create(k, TwInfo, {Transparency = 1})
TextAndBack:Play()
end
end
end
end
Change this part of the code to this one above
It still wants to overlap it seems
add a print("Message Detected") below this line of code:
if chatScrollBox:FindFirstChild("AvatarChatDisplayHUD") then
then tell me if it's printing or not
Just like this?
yes
if chatScrollBox:FindFirstChild("AvatarChatDisplayHUD") then
print("Message Detected")
local chatmessage = chatScrollBox.AvatarChatDisplayHUD
for i, k in pairs(chatmessage:GetDescendants()) do
if k:IsA("ImageLabel") or k:IsA("ImageButton") then
local BackG = TweenService:Create(k, TwInfo, {BackgroundTransparency = 1})
local Image = TweenService:Create(k, TwInfo, {ImageTransparency = 1})
Image:Play()
if k:IsA("Frame") or not k:IsA("Frame") then
BackG:Play()
end
end
if k:IsA("GuiButton") then
local TextAndBack = TweenService:Create(k, TwInfo, {Transparency = 1})
TextAndBack:Play()
end
end
end
replace it
I get this, and it doesn't allow me to send a message.
** You are now Level 3! **
you probably added an extra end to the code
local function AddMessageToScrollBox(playerName, message)
if chatScrollBox:FindFirstChild("AvatarChatDisplayHUD") then
print("Message Detected")
local chatmessage = chatScrollBox.AvatarChatDisplayHUD
for i, k in pairs(chatmessage:GetDescendants()) do
if k:IsA("ImageLabel") or k:IsA("ImageButton") then
print("Image1")
local BackG = TweenService:Create(k, TwInfo, {BackgroundTransparency = 1})
local Image = TweenService:Create(k, TwInfo, {ImageTransparency = 1})
Image:Play()
print("Image2")
if k:IsA("Frame") or not k:IsA("Frame") then
BackG:Play()
end
print("FrameOrImage")
end
if k:IsA("GuiButton") then
local TextAndBack = TweenService:Create(k, TwInfo, {Transparency = 1})
TextAndBack:Play()
print("Label")
end
end
end
local MessageUI = ReplicatedStorage:FindFirstChild("AvatarChatDisplayHUD"):Clone()
MessageUI.Parent = chatScrollBox
MessageUI.ChatFrame.NameAndTime.PlayerNameLabel.Text = playerName .. " "
local currentTime = os.date("*t")
local formattedTime = string.format("%d:%02d %s", (currentTime.hour % 12 == 0) and 12 or currentTime.hour % 12, currentTime.min, (currentTime.hour >= 12) and "PM" or "AM")
MessageUI.ChatFrame.NameAndTime.TimeLabel.Text = formattedTime
MessageUI.ChatFrame.MessageLabel.Text = message
end
replace the function AddMessageToScrollBox with this:
Yeah I think that's what I must've done. This is what I have put under local function AddMessageToScrollBox (playerName, message)
So I would replace everything under local function addmessagetoscroll box with the code you provided last?
Okay, so, replace what I have highlighted then?
I do apologize, I'm not too familiar with the scripting part, just environmental parts.
no
The whole function, until its end
but it worked
and did it dissapear?
It's still overlapping the past messages with the current one
oooh
I just realized what's wrong
if chatScrollBox:FindFirstChild("AvatarChatDisplayHUD") then
print("Message Detected")
local chatmessage = chatScrollBox.AvatarChatDisplayHUD
chatmessage:Destroy()
end
Try this one first
just to test something
remove the for loop
yes
errors?
there's an ending missing
replace this with this:
local function AddMessageToScrollBox(playerName, message)
if chatScrollBox:FindFirstChild("AvatarChatDisplayHUD") then
print("Message Detected")
local chatmessage = chatScrollBox.AvatarChatDisplayHUD
chatmessage:Destroy()
end
local MessageUI = ReplicatedStorage:FindFirstChild("AvatarChatDisplayHUD"):Clone()
MessageUI.Parent = chatScrollBox
MessageUI.ChatFrame.NameAndTime.PlayerNameLabel.Text = playerName .. " "
local currentTime = os.date("*t")
local formattedTime = string.format("%d:%02d %s", (currentTime.hour % 12 == 0) and 12 or currentTime.hour % 12, currentTime.min, (currentTime.hour >= 12) and "PM" or "AM")
MessageUI.ChatFrame.NameAndTime.TimeLabel.Text = formattedTime
MessageUI.ChatFrame.MessageLabel.Text = message
--local TextLabel = Instance.new("TextLabel")
--TextLabel.Parent = chatScrollBox
--TextLabel.Text = message
--TextLabel.TextSize = 14
--TextLabel.TextWrapped = true
--TextLabel.Size = UDim2.new(1, 0, 0, TextLabel.TextBounds.Y) -- Adjust height based on text size
--TextLabel.TextXAlignment = Enum.TextXAlignment.Left
--TextLabel.BackgroundTransparency = 1
--TextLabel.TextTransparency = 0
--TextLabel.TextColor = Color3.fromRGB(255, 255, 255)
end
Alright, I've done that, and this is the result.
did it overlap?
It doesn't send the message
It's hard to tell what's wrong if i'm not editing the system :/, I don't know what else could be wrong
alright so I got another solution
Alright, well one last thing I can do is just send a short video of what's all here and if you'd like to take a look at the scripts, properties, I can provide them. If that's easier?
revert the code to the way it was before
when I didn't edit it
Now make a local script inside the AvatarChatDisplayHUD
did you do it?
when you do it, copy and paste this code into the localscript:
local GUI = script.Parent
local SendMessageRE = ReplicatedStorage:WaitForChild("SendMessageRE")
local function Fading()
print("Deleting message...")
if GUI.Parent ~= ReplicatedStorage then
GUI:Destroy()
end
end
SendMessageRE.OnClientEvent:Connect(Fading)
Had to fix an error, accidently deleted some code so I had to restore it.
I've done that, though I have an error with replicated storage
what does the error say?
** You are now Level 4! **
ooh
forgot to set replicated storage
change it to:
local SendMessageRE = game:GetService("ReplicatedStorage"):WaitForChild("SendMessageRE")
Alrighty, I've done that
** You are now Level 18! **
local GUI = script.Parent
local Storage = game:GetService("ReplicatedStorage")
local SendMessageRE = Storage:WaitForChild("SendMessageRE")
local function Fading()
print("Deleting Message")
if GUI.Parent ~= Storage then
GUI:Destroy()
end
end
SendMessageRE.OnClientEvent:Connect(Fading)
replace all the code with it
So that removes the GUI when I hit enter upon sending a message
I see
so, did it work?
Sorry, no, it still overlapped
did it print the message?
local GUI = script.Parent
local Storage = game:GetService("ReplicatedStorage")
local SendMessageRE = Storage:WaitForChild("SendMessageRE")
local function Fading()
print("Deleting Message")
if GUI.Parent ~= Storage then
GUI:Destroy()
end
end
SendMessageRE.OnClientEvent:Connect(function()
task.delay(0.5, Fading)
end)
try this one
So it sends the message, waits then removes it, but it also removes the chat box and bottom icon below
Can you send me a screenshot of the Gui's?
As in what it does after using that code, or just the GUI itself?
the GUI itself
I need to know what the message pop up is exactly
if it is a certain frame, etc
select all the Gui Objects that is the pop up
I’m not following, do you mean select all the children of both GUIs?
alright, this time highlight just this part:
oh wait
is the localscript under AvatarChatDisplay?
and here's an updated version:
local GUI = script.Parent
local Storage = game:GetService("ReplicatedStorage")
local SendMessageRE = Storage:WaitForChild("SendMessageRE")
local function Fading()
if GUI.Parent ~= Storage then
print("Message deleted")
GUI:Destroy()
end
end
SendMessageRE.OnClientEvent:Connect(function()
task.delay(0.1, Fading)
end)
I have it under ScreenGui here
Should it be under AvatarChatDisplayHud instead?
edited the code
copy it again
My bad, let me switch that
Alright
sweet
Now I just have to test and see if works with somene, I appreciate the time you spent helping with this