InputChanged is super delayed

Hey there! So I’m creating a currency exchange GUI, everything is working fine, however, when I type in the text box to convert (cash → gems), it won’t show the gems amount until 5-10 seconds later. (I want the user to be able to type in their cash amount in the cash textbox, and a textlabel will show how much that is worth in gems amount. The first time that the Input changes, it’s super smooth, however after that it has a huge delay). Thanks in advance!

script.Parent.InputChanged:Connect(function(input)
	local cash = tonumber(script.Parent.Parent.cashBox.Text)
	if cash then
		script.Parent.Parent.gemsBox.Text = math.floor(cash / 10)
	end
end)

https://gyazo.com/4597ffe803330e8d283243aeced7aed2

Could you try printing out the cash variable outside the if statement?

Yes, it prints the text value I put, however it’s delayed

Is InputChanged the event you want? I’m pretty sure it doesn’t fire when the text changes (to see if this is the case, add print(input.UserInputType)). I’m pretty sure the event you’re looking for is TextBox:GetPropertyChangedSignal("Text") (where TextBox is the text box you enter information into).

You might also want to use TextBox.FocusLost.

1 Like

Yeah, I tried print(input.UserInputType), and it only gives back Enum.UserInputType.MouseMovement, not any keyboard movements. I’ll try GetPropertyChangedSignal. I don’t want to do FocusLost because I want the gems value to update live, not whenever they click off

GetPropertyChangedSignal works, thanks.