mlg_lmg2
(murphtastic)
January 16, 2022, 5:47am
#1
What do you want to achieve?
Something that can detect if there is text in a textbox, and if there is then it makes a button appear
What is the issue?
Can’t figure out on how to get it working
What solutions have you tried so far?
if script.Parent.displa.Text ~= "" then
script.Parent.button.Visible = true
else
script.Parent.button.Visible = false
end
I have also tried .InputChanged and it didn’t work either
3 Likes
Use .InputChanged to detect changes.
mlg_lmg2
(murphtastic)
January 16, 2022, 5:52am
#3
I’ve already tried that, it doesn’t work
bleintant
(bleintant)
January 16, 2022, 5:53am
#4
You could use TextBox.FocusLost and get the text in the Textbox afterwards.
https://developer.roblox.com/en-us/api-reference/event/TextBox/FocusLost
You can use GetPropertyChangedSignal()
TextBox:GetPropertyChangedSignal("Text"):Connect(function()
end
5 Likes
mlg_lmg2
(murphtastic)
January 16, 2022, 8:25pm
#6
As I’ve mentioned before I already have tried this but it still doesn’t work,
the script is a local script.
You already try with “While wait() do”?
local textbox = script.Parent.TextBox
local button = script.Parent.TextButton
while wait() do
if textbox.Text == “YourText” then
button.Visible = true
else
button.Visible = false
end
end
1 Like
mlg_lmg2
(murphtastic)
January 16, 2022, 10:27pm
#8
Just tried it and it worked, thank you for your help.
Spafuji
(Spafuji)
January 21, 2024, 7:03pm
#9
The answer you provided not only freezes the selected thread for an eternity but also does contain an unwanted loop
textbox:GetPropertyChangedSignal("Text"):Connect(function()
button.Visible = text.Text == "desiredText"
end)
5 Likes
system
(system)
Closed
February 4, 2024, 7:03pm
#10
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.