Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to detect when ImageRectOffset has changed?

I want to detect when the ImageRectOffset in an imagelabel changes to a certain number, how can this be done?

local Gui = script:FindFirstAncestorOfClass("BillboardGui")
local Image = Gui:FindFirstChildOfClass("ImageLabel")

local Resized = Image:GetPropertyChangedSignal("ImageRectOffset")

Resized:Connect(function()
	if Resized == Vector2.new(430,430) then
		print("changed")
	end
end)

1 answer


local Gui = script:FindFirstAncestorOfClass("BillboardGui")
local Image = Gui:FindFirstChildOfClass("ImageLabel")

local Resized = Image:GetPropertyChangedSignal("ImageRectOffset")

Resized:Connect(function()
    if Image.ImageRectOffset == Vector2.new(430,430) then
        print("changed")
    end
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.