I'm making this custom chat thingy and my script got a weird error. here is my script: (its in serverscrptservice)
player.Chatted:connect(function(msg)
local m = Instance.new("Hint")
m.Parent = game.Workspace
m.Text = (msg)
wait(1)
if player.Chatted:connect(function(msg)
m:Destroy()
end)
end) -- expected 'then' got end
end)
I changed end) to end but it is still not working so I changed it back. any ideas?
Thanks for reading!
I also added then to it but then it said
Expected identifier got 'then'

5 comments
Why do you have an 'if on line 6?
I want it to detect if another person chatted, then destroy the current message so the messages won't build up on each other.
I'll tell you - that's definitely not the way to do it.
Then, what is?
Also, it's not creating a hint every time someone chats.