I have a surfacegui text box and put this script inside it. It’s supposed to reset the text when the player clicks out of the text box but it doesn’t trigger the event and I don’t know why.
local textBox = script.Parent
local defaulttext = textBox.Text
--when a player stops typing reset text
textBox.FocusLost:Connect(function()
textBox.Text = defaulttext
end)
my script works for my textbox in player gui. i dont want to clear the textbox just put the original text back. my problem is the event doesnt even fire, i checked with a print statement
So you’re saying even though this is a surfacegui in a part on the server, i need to also use a local script in addition to the server script? how is that possible for this?
Focuslost is an event that fires when the client’s focus leaves a textbox. It helps detect when a client clicks/taps outside of the TextBox. Keyword client meaning it cannot be used for this. I’m simply asking for an equivalent for the server since nothing seems to work. How do you suggest I use a remote event with this server-sided object, let alone without focuslost in the local script, since you seem to adamant against the use of it.