Inputs aren't working in plugin widgets [SOLVED]

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)

nothing prints

bumping this need help please 30

I need help understanding the file hierarchy, Is the text variable actually pathing into the TextBox instance?

bump, i got no response waaaaa

hello, have you understood the file hierarchy yet?

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

try seeing if the script runs at all. if it doesnt then move all of this code to the main plugin script

ye it’s running, added prints everywhere in the script and all of them ran

i still can’t figure out a solution, please somebody help

i wonder how many times i’m gonna have to bump this lol

everything works when done in the main plugin script which makes the widget apparently, i’ll keep that in mind for future projects

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.