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

Widget unable to get input in a textbox, instead prints the text set before the plugin was saved. Y?

Asked by 2 years ago

I was trying to make a plugin with a widget that inserts objects into a gui thingy I'm making, (unrelated) which uses 3 frames and textboxes to get user input. The frames can and are inserted into the widget, however when I try to get the user input from the textboxes, all I get is the text values from when I first made the textboxes. I've tried putting localscripts in the frames for input, used a localscript instead of a script for the plugin, and yet no matter what the script couldn't get the user input. Any reason as to why this is happening? And how could I go about fixing this? (yes this is a repost from reddit, r/robloxgamedev wasn't quite helpful)

local widgetinfo = DockWidgetPluginGuiInfo.new(
    2, true, false, 200, 300, 150, 150
)
local test = plugin:CreateDockWidgetPluginGui("Widget", widgetinfo)
test.Title = "Make a new item"
local frames = game:GetService("InsertService"):LoadAsset(9512533755)
for i,v in pairs (frames:GetChildren()) do
    v.Parent = test
end
frames:Destroy()
local creator = test.CreateItem
local badgeid = creator.BadgeID.Text
local imageid = creator.ImageID.Text
local difficulty = creator.Difficulty.Text
local name = creator.Name.Text
local hint = creator.Hint.Text
local description = creator.Description.Text
local create = creator.Create
create.MouseButton1Click:Connect(function()
    print("BadgeID: "..badgeid.."\nImageID: "..imageid.."\nDifficulty: "..difficulty.."\nName: "..name.."\nHint: "..hint.."\nDescription: "..description)
end)

Answer this question