So i found a script that makes sound play when a letter was said. For example: when user says "hi my name is coolboy" the sound plays 18 times, because there are 18 letters. I hope you understood what i meant. Heres the script: local UIS = game:GetService("UserInputService") UIS.InputBegan:Connect(function(k) if k.KeyCode == Enum.KeyCode.KeypadEnter then for i = 1, string.len(UIS:GetFocusedTextBox().Text) do script.Sound:Play() wait(0.1) end end end)

In the output it says that "Players.Sticky_Kermo.PlayerScripts.LocalScript:4: attempt to index nil with 'Text'" This local script is the only script in the whole workspace ( i mean there are no more scripts). I enabled the bubble chat using the "Chat" Folder that was already in roblox studio. And there are no guis located in any other folders. Theres also sound parented to the localscript Please help me

2 comments

0

Quite simply, there is no focused TextBox. That's your problem. You need to check if there is a focused TextBox before assuming that said TextBox is focused.

0

But how do i make it work with original bubble chat? Or should i make a custom bubble chat system and connect this script to the textbox?