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.
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).
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.
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.
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.