Alright, so I'm trying to check if the enter key was pressed on a textbox, and it works in Studio. However, it doesn't work in game. I've put a wait(1) before it and it still isn't working. Can anyone troubleshoot this code?
game.Players.PlayerAdded:connect(function(player)
wait(1)
player.PlayerGui.Chat.Frame.TextBox.FocusLost:connect(function(enter)
if enter then
print('Pressed enter')
end
end)
end)
This doesn't give any errors, and it's running in a server script. I'm also sure it is the focuslost event not working because I did print(1) after playeradded, print(2) after the event. It didnt print 2.
Thanks!