GetPropertyChangedSignal Can't find a argument in a property

What I wanted to achieve?

I wanted to make a script that will check if only the Y was changed in the TextBounds property using the :GetPropertyChangedSignal() Function. But I couldn't seem to find anything that could help it.

My Workings.

This will be my demo code that is going to print Hello world when a property was changed.
wait(2)
script.Parent.Parent:GetPropertyChangedSignal("TextBounds"):Connect(function()
-- Just a note that no errors are found. It's only to find something or a script that could help this Textbound.Y Issue.
print("Hello World!") -- This will change when each letter is made or deleted instead of making or deleting a line.
end)

I tried using the .Changed Local Property script. But then realized that you can only use the index instead of a property.


Any help is appreciated!

You could try something like this

wait(2)
local textthing = script.Parent.Parent
local oldy = textthing.TextBounds.Y
textthing:GetPropertyChangedSignal("TextBounds"):Connect(function()
	if textthing.TextBounds.Y == oldy then return end
	print("Hello World!")
	oldy = textthing.TextBounds.Y
end)

That way if only the X was changed, nothing will happen, but if the y was changed, do something and set oldy to the new Y

1 Like