How to change a value without firing the changed event?

Title explains all. I tried using an index like an ignore list thingy but that just caused more problems. Anyone have any ideas?

EDIT: If you were confused, my bad. I meant value as in property. I’m asking how I can change a property of an instance without firing the changed event.

.Changed is an event that occurs when the value is changed. You don’t change the value with that event.

If you want to change a value, do example
Cash.Value = 100

1 Like

Can you provide some code? Your post doesn’t quite explain what you’ve done.

1 Like

This is not possible. You can create a new value instance and then reconnect the event connections if you had any or the second idea is that you can disconnect the connections, change the value and reconnect them again (this one doesn’t need the value instance to be removed or created).

3 Likes

Perhaps a workaround you could do is a if-else statement of a bool. You assign a variable to either true or false and use the if-else statement to check the opposite of the variable. Set the bool on or off w
whether you want the changed event to change values.


local changeable = true

ValueObject.Changed:Connect(function()
    if changeable then
        -- code here
    end
end)

-- example function for disabling it
local function toggleChangeable(bool)
    changeable = bool or not changeable -- lol
end
  • Alternatively, you could change the name of “changeable” to “locked”, as you lock the value.

The problem with that is it can get confused and skip a change it wasn’t supposed to.

Were you meaning that the Changed event was firing unnecessarily or it is not firing at the right time?


The former one can be worked with GetPropertyChangedSignal(property).
The latter one can be explained that you are changing the values from the client while server is checking it.

I’m asking how I can change a property (Example: game.Workspace.Baseplate.Transparency = 1) without firing any .changed events or a :getpropertychangedsignal.

Unfortunately, they are in-built events and you cannot avoid them unless you use the bool workaround.

Is there a way to tell an event fire apart from another like how most instances have numbers?

You are not being clear here, could you elaborate?

1 Like

Yes, there is. Though it’s not as straight forward as you’ve described.

When you make a change, the event will instantly fire as if it were all continuous.

part.Changed:Connect(function ()
  print("2")
end)

print("1")
part.Transparency = 1
print("3")

Knowing this, you can write code that only runs in certain situations. The issue you’ll run into is that you’ll need to do this for every event connection.

local ignoreEvent = false

part.Changed:Connect(function ()
  if ignoreEvent then
    return
  end
  print("won't always run")
end)

ignoreEvent = true
part.Transparency = 1
ignoreEvent = false

If you know where all events are connected, you can actually have them all run that check before their main body or you can have a single function connect to the event and call anything that would be interested in the changed event.

Changed events are baked into objects as far as you, the developer, are concerned. Changed is fired internally and you cannot escape this behaviour; naturally, then, you cannot change an instance property without the event also firing.

To “avoid” Changed or attain granular control over it:

  • Don’t connect to it.
  • Create a boolean to “escape” it, like the sample above.
  • Create a custom signal to fire off for certain changes (use BindableEvents to make this easier).

Just know that replication doesn’t occur naturally for any of these choices and you will have to account for this yourself if at all necessary.

1 Like