Well, this marks an hour trying to debug this. If I don’t ask for help, I’ll likely go insane.
So, I’ve been trying to code a GUI that creates a ScrollingFrame, and you select from a bunch of TextButtons, which assigns a value to a StringValue. I detect when the StringValue is changed, and close the options menu (which happens when the text button is clicked using the following:
repeat wait() until script.Parent.Selected.Changed
I assign values to the StringValue using the following:
for i, playerGame in pairs (playerGames) do
local frame = Instance.new("Frame", gamesFrame.Options)
local textButton = Instance.new("TextButton", frame)
textButton.Name = playerGame
textButton.Text = playerGame
textButton.MouseButton1Click:Connect(function()
script.Parent.Selected.Value = textButton.Text
end)
end
Yet every time I click to open the options, the window auto closes. I’ve tried not regestering these until there are new inputs, which has failed. I tried using :GetPropertyChangedSignal(), which has also failed. No error messages, I’ve tried printing the new value and it hasn’t changed. I’m 100% stumped.
Any, and I mean ANY, help is appreciated !