Then you can use GetPropertyChangedSignal() or in this case just Changed to detect if the value has changed
local Int = workspace.IntValue
Int.Changed:Connect(Function(val)
--code
end)
Is there a way to do the same (Detecting if something changed) but with variables in scripts instead like the number variable in the at the top of this post?
local Number1 = 5
local Number1ChangedEvent = Instance.new("BindableEvent")
Number1ChangedEvent.Event:Connect(function(newValue)
Number1 = newValue
end)
-- to change the value of Number1, you can fire the event like this:
Number1ChangedEvent:Fire(10)
As I understood. You may be looking for modules that does this, like Fusion. Or can look on how they are made, the methods, like how the variable value detector method is made, I’m pretty sure you create functions to see if a variable is changed by calling the method / function on it.
Fusion has the watch() method to see if a variable value changes.