Message = script.Parent["Message"]
Chatbar = script.Parent
function Chat()
local mouse = game.Players.LocalPlayer:GetMouse()
mouse.KeyDown:connect(function (key)
if key == 'enter' then
game.Players.PlayerAdded:connect(function(pl)
pl.Chatted:connect(function(msg)
msg = Message.Text
end)
end)
end
end)
end
✓ ANSWER ACCEPTED
Would this work for a custom Chatbar?
1 answer
✓ Accepted answer
You'd have to change if key == 'enter' then to if key == string.char(13) then. I believe that's the correct number. If it isn't, go here: Taking Keyboard Input. I hope this helped!
This discussion is preserved as it was. New answers, comments, and votes are closed.
