Created
January 24, 2023 03:32
-
-
Save BeboKhouja/23e2a31e93a5d4b4029271415991bf22 to your computer and use it in GitHub Desktop.
To send messages via a textbox.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local Chat = game:GetService('Chat') | |
local Players = game:GetService('Players') | |
local Player = Players.LocalPlayer | |
script.Parent.FocusLost:Connect(function(enter) -- when the enter key is pressed | |
if enter then -- if the enter key is pressed | |
game:GetService("ReplicatedStorage").DefaultChatSystemChatEvents.SayMessageRequest:FireServer(Chat:FilterStringAsync(script.Parent.Text, game:GetService('Players').LocalPlayer, game:GetService('Players').LocalPlayer), "All") -- Filters the string, sends it to chat. | |
end | |
end) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment