Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to detect when ImageRectOffset has changed?

Asked by 1 year ago

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

Log in to vote
0
Answered by 1 year ago

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

Answer this question