Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

(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?

01local chatInput = script.Parent:WaitForChild("ChatInput")
02local uis = game:GetService("UserInputService")
03local onChatInputted = game.ReplicatedStorage:WaitForChild("OnChatInputted")
04local cooldown = 1
05local isCoolingDown = false
06 
07uis.InputBegan:Connect(function(key, gameProcessed)    
08    if key.KeyCode == Enum.KeyCode.Slash and not gameProcessed then        
09        chatInput:CaptureFocus()       
10    end
11end)
12 
13chatInput.FocusLost:Connect(function(enterPressed)
14    if not enterPressed then return end
15    local input = chatInput.Text   
View all 28 lines...

1 answer

Log in to vote
0
Answered by 5 years ago

Add a wait(0.1) between lines 08 and 09 :)

Ad

Answer this question