You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
run code on a specific child of a model, whenever it changes color
What is the issue? Include screenshots / videos if possible!
im not sure how to approach this
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
i tried using Instance.Changed on the model but it doesnt work
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
model.Changed:Connect(function()
if changedPart.BrickColor == BrickColor.new("Tawny") then
print("its tawny now!")
elseif changedPart.BrickColor == BrickColor.new("Shamrock") then
print("its shamrock now!")
end
end)
local model = --model
for i, v in pairs(model:GetChildren()) do
v.Changed:Connect(function()
if v.BrickColor == BrickColor.new("Tawny") then
print("its tawny now!")
elseif v.BrickColor == BrickColor.new("Shamrock") then
print("its shamrock now!")
end
end)
end
connecting .Changed will only fire when that instance gets a property update, so in this case it will not fire when its children change. The first reply should work. Keep in mind that you can also read what property changed by doing the following
I use .Changed for almost every one of my scripts, have you ever used .Changed? It fires whenever a property of connected instance is changed. Consider reading the developer documentations before claiming things. Also notice how the author marked the first reply as a solution? almost as if it worked because .Changed works for every instance
if you read the actual article you sent what they’re saying is ValueBase instances do not have the same .Change as the other instances in the game. But the other instances do still have a functional .Changed that fires when any property is changed, including hidden ones.
Next step is to learn how to read the documentations. As you can see if you read the documentations you sent, you can clearly see that .Changed is infact an inherited event
Every signle instance has .Changed
as you can see, .Changed does not print nil, it prints the signal
compared to stuff that doesn’t have .Changed (not instances)