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

How do you make a script that changes back to text when you click off of it?

Asked by 10 years ago

So I made a GUI, but I need to know how to make it change it's text back to "Decal ID Here", when a player stops typing on it, and clicks on something else.

3 answers

Log in to vote
0
Answered by
Hybric 271 Moderation Voter
10 years ago

use this: while true do if script.Parent.Text == " " then script.Parent.Text = "Decal ID Here" end end

Thats the script text ^^^, paste that into script, well type that into script. then put script inside the TextBox.

0
while true do if script.Parent.Text == "" then script.Parent.Text = "Decal ID Here" end end Hybric 271 — 10y
0
Didn't work. Wrongmistake 0 — 10y
0
Hmm it should, maybe put an enter button adn make a script on that. Hybric 271 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

What he said ^

0
Didn't work Wrongmistake 0 — 10y
Log in to vote
0
Answered by
M39a9am3R 3210 Moderation Voter Community Moderator
10 years ago

Try this, it is to be put in a local script under the TextBox.

script.Parent.FocusLost:connect(function(enterPressed)
if enterPressed then
print("Focus was lost because enter was pressed!")
end
end)

Source http://wiki.roblox.com/index.php?title=FocusLost_%28Event%29

0
It isn't a textlabel it's a textbox... Wrongmistake 0 — 10y
0
Oh, sorry. I meant TextBox, let me do a quick edit. M39a9am3R 3210 — 10y

Answer this question