i’m using a textbox and trying to use focuslost to detect if the player presses enter, but it doesn’t work for some reason
the script is inside the textbox
the code works fine in normal guis, but not in plugin widgets
code
local mps = game:GetService("MarketplaceService")
local plr = game.Players.LocalPlayer
local mainframe = script.Parent.Parent.Parent
local text = script.Parent
local msgevent = mainframe:WaitForChild("msgevent", 10)
local gameinfo = mps:GetProductInfo(game.PlaceId)
text.PlaceholderText = "Message #"..tostring(gameinfo.Name)
local function focuslost(enter)
print("check1")
if enter and text.Text ~= "" then
print("check2")
if msgevent then
print("sending")
msgevent:Fire(plr.DisplayName, text.Text)
end
text.Text = ""
end
end
text.FocusLost:Connect(focuslost)
bump, i still can’t figure it out i’ve searched everywhere
i’ve tried what the docs say, by making a transparent frame and detecting input from it
i’ve tried every single method of detecting input but none work
i can type into the textbox just fine, but theres no way to detect if i’m pressing enter on it