I have a function called TrackInputs() and its used for detecting when a player presses a certain key all the inputs that come so text is displayed on the screen. However this connects UIS.InputBegan multiple times causing the letters to duplicate.
First, I’d reccomend switching over to Context Action Service it does exactly what I think you are trying to do. You can easily bind and unbind functions with it.
If you are dead set on using User Input Service then you can store it into a variable. Such as: local connection = UIS.InputBegan:Connect(SomeFunction) To disconnect the variable now all you need to do is: connection:Disconnect() To read more about events and functions here is a nice article.
You could also add a boolean to your function. Although I wouldn’t recommend it.
3 Likes
Thank you storing it as a variable worked perfectly! I know about CAS but to my understanding isn’t that for individual inputs?
1 Like