(Answered) How do I get rid of slash in custom chat's chat bar?
Asked by
5 years ago Edited 4 years ago
I open my custom chat's chat bar and whatever I type starts with "/". How do I stop the slash from proceeding everything I type so I may go straight to typing into the chat rather than have to backspace the slash out?
01 | local chatInput = script.Parent:WaitForChild( "ChatInput" ) |
02 | local uis = game:GetService( "UserInputService" ) |
03 | local onChatInputted = game.ReplicatedStorage:WaitForChild( "OnChatInputted" ) |
05 | local isCoolingDown = false |
07 | uis.InputBegan:Connect( function (key, gameProcessed) |
08 | if key.KeyCode = = Enum.KeyCode.Slash and not gameProcessed then |
09 | chatInput:CaptureFocus() |
13 | chatInput.FocusLost:Connect( function (enterPressed) |
14 | if not enterPressed then return end |
15 | local input = chatInput.Text |
18 | if string.len(input) > 0 then |
19 | if isCoolingDown = = true then |
20 | chatInput.Text = "Wait for cooldown to end!" |
24 | onChatInputted:FireServer(input) |