Issue with textbox effect

Hello i have bug in my script

  1. I wanna make the clicking effect when player is inputing an text

  2. The issue is that when im holding an key it does spam-play sound

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

script.Parent:GetPropertyChangedSignal("Text"):Connect(function()
	script.Parent.Text = script.Parent.Text:sub(1,16)

		local sound = Instance.new("Sound", script.Parent)
		sound.SoundId = "rbxassetid://9113868645"
		sound:Play()
		sound.Stopped:Connect(function(soundId)
			sound:Destroy()
		end)

	--script.Parent.Text = string.rep("*", #script.Parent.Text)
end)

script.Parent:GetPropertyChangedSignal("Text"):Connect(function()



--Test thing...
	
end)

I need the issue to get solved due to im making some type of notepad.
Thanks!

Im new to posting! Also i don’t know english too much

1 Like

This fires every time the text changes. It will play the sound even if you hold it. I recommend using either a debounce or UserInputService.

Nevermind, got it thanks!

Okay thanks, but how to i get all keys A-Z on Enum.Keycode?