How am I able to set a new intvalue? I have a certain value and that value is 1 I want to 1 to change to 2 on a touch based function. How would I do that?
Remember that this isn't a request site, but as it was only a small request I will be happy to do it.
I was completely unsure of what you meant as your question contained very little detail, but I just made it so that when a part is touched it will change a value to 2. I also added a debounce so that the code will not run multiple times. Here is the code that I put together.
Code:
local intvalue = 1 local debounce = false script.Parent.Touched:Connect(function() if not debounce then debounce = true intvalue = 2 wait(5) debounce = false end end)
Please accept my answer if this is the code that you wanted. :)
Closed as Not Constructive by hiimgoodpack and Fifkee
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?