-- Also activate when the Action Button is pressed

local function OnChildAdded(child)
	if child.Name == 'ActionButtonData' then
		child.Changed:connect(function(newValue)
			local bindable = child:FindFirstChild('GetTargetPosition')
			if bindable and string.sub(newValue, 1, 1) == 'v' then
				local matches = {}
				for match in string.gmatch(newValue, '%d+%.?%d*') do
					table.insert(matches, match)
				end
				if #matches == 4 then
					local screenPosition = Vector2.new(matches[1], matches[2])
					local screenSize = Vector2.new(matches[3], matches[4])
					local targetPosition = bindable:Invoke(screenPosition, screenSize, {MyModel})
					OnActivated(targetPosition)
				end
			end
		end)
	end
end
