I don’t think it will hinder your performance too much. As long as that line of code isn’t used many times per minute / second you should be good to go. I have certain inefficient parts of code in the games that I work on, these are for cases in which it wouldn’t make sense to optimize since it’s only running once every 5 mins.
Never use a repeat loop to check for a change. It is very unefficient as wait may take more than the specified time. Please use GetPropertyChangedSignal:Wait()
The problem I’m having with the GetPropertyChangedSignal:Wait() is that it continues to wait after the value has changed. I’m not sure if this is because I am calling a function between the value changing and reaching the line where it checks if it has changed.
The first code would be used for physical variables (values and properties) And the second for variables in scripts (debounce), although the second could be more secure in some cases (maybe as verification)
Value objects have a dedicated Changed event, using GetPropertyChangedSignal is just not correct for this property. Also, your two code variations are not equivalent code. Both check the value, but one (once fixed) would wait for it to be true, while the other just waits for any change.