Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Would this work for a custom Chatbar?

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

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.