I was learning roblox lua and done some researches, and I found out GetPropertyChangedSignal but in the script they use both getpropertychangedsignal and changed function here's the script of them.
local part = Instance.new("Part") local function onBrickColorChanged() print("My color is now " .. part.BrickColor.Name) end -- Manual detection of a property change local function onChanged(property) if property == "BrickColor" then onBrickColorChanged() end end -- Connect both events part:GetPropertyChangedSignal("BrickColor"):Connect(onBrickColorChanged) part.Changed:Connect(onChanged) -- Trigger some changes (because we connected twice, -- both of these will cause two calls to onBrickColorChanged) part.BrickColor = BrickColor.new("Really red") part.BrickColor = BrickColor.new("Institutional white")
I'll accept answers that give sense and is right!