All I'd like to know is how to shorten this into a single variable for each event.
debounce1 = false
debounce2 = false
debounce3 = false
part.Touched:Connect(function()
debounce1 = true
end)
part2.Touched:Connect(function()
debounce2 = true
end)
part3.Touched:Connect(function()
debounce3 = true
end)
This is what I am looking for:
debounce1 = false
part.Touched:Connect(function()
debounce1 = true
end)
part2.Touched:Connect(function()
debounce1 = true
end)
part3.Touched:Connect(function()
debounce1 = true
end)
Although I am trying to figure out how to make it so that debounce1 only changes for that specific event and doesn't interfere with each other.
I've done a bit, tried to make a table to store each one then another table to load it specifically for the event, the problem with that was that the default values couldn't be changed unless it was changed in the event which in that case a loop would make it harder to code.
I tried making a function that returns values but then again, I couldn't change the original values, I tried making it specifically work
I'd like some ideas, thanks for the help and time.
The reason I asked this is because it would make my code neater and easier to read and also, it would reduce the memory consumption.

1 comment
What do you mean default values can’t be changed?